A pointer to the program unit was added to the program line reader class. The new program model create program line reader function was to pass the pointer to itself to the program line reader constructor. An access function was added for this pointer. The program unit pointer argument was removed from all of the operand text and remove functions. The same changes was made to the token constructor for program words, which also has a program line reader argument.
Unfortunately, the resulting operand text and remove functions have an undesirable calling chain, which existed before, but now was extended another level. This is undesirable because it breaks encapsulation, meaning that these functions have knowledge of the internals of each class in the chain. Considered the statements of the REM operand text function:
auto operand = programLineReader();This function has knowledge that the program line reader has a unit pointer member, that the unit pointer member has REM dictionary member, and that the dictionary has the string function. These statements are also unusual in that a program word is read from the program line reader, and then passed back to the program line reader through a chain of calls. This issue will be rectified with the next change.
return programLineReader.unit()->remDictionary()->string(operand);
[branch table commit 66a0db8247]
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)