RecordFlux icon indicating copy to clipboard operation
RecordFlux copied to clipboard

Representation of null messages

Open treiher opened this issue 3 years ago • 2 comments

Null messages are currently represented by an empty structure in AbstractMessage. This leads to special handling in some cases. For example in graph and pyrflx.typevalue:

178         assert isinstance(self.__data, Message)
179 
180         if not self.__data.structure:
181             self.__data.structure = [Link(INITIAL, FINAL)]
639         # structure is empty for NULL messages
640         if field == FINAL or not self._type.structure:
641             return None

Representing a null message by a structure of a single link from INITIAL to FINAL could make these special cases unnecessary.

treiher avatar Apr 12 '21 08:04 treiher

Maybe I misremember that, but I think we had it like that in the past (or considered that option) and there was a reason to have the special handling. Getting rid of that would indeed be good!

senier avatar Apr 12 '21 08:04 senier

Maybe I misremember that, but I think we had it like that in the past (or considered that option) and there was a reason to have the special handling. Getting rid of that would indeed be good!

Yes there was a specific reason to do it like this although I can't remember what it was.

jklmnn avatar Apr 12 '21 08:04 jklmnn