What is the role of Binary? #261
-
After 802c786, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
The structural classes If there is a more actionable issue to address in form of code, please feel free to create an issue for that. |
Beta Was this translation helpful? Give feedback.
-
Why? There are many scenarios where we do not care about the order of the constituents of a node. E.g., when we pretty print a node. In those scenarios, we are not interested in the deeper meaning of the children, we only want to make sure we visit everything we are interested in. No longer capturing these commonalities for some nodes can increase the complexity of some user code as we will no longer be able to use our generic Binary printer for Moreover, IPR gives little to no guidance on how it should be used/created/consumed. These methods should not have been relied on were not clearly communicated anywhere. I am ok with IPR not considering these part of the interface, but in that case I believe IPR should provide the facilities to traverse the graph. |
Beta Was this translation helpful? Give feedback.
The structural classes
Unary
,Binary
, andTernary
are devices to capture structural commonalities of various IPR nodes in order to reduce implementation complexities (see how their are used<ipr/impl>
). Their accessor functions are non-descriptive names such asfirst()
,second()
, andthird()
and -- in general -- not reflective of a deeper meaning. In particular, any permutation of such accessors is a structural isomorphism. Consequently, they are not interface functions to rely on directly. Of course, there are exceptions, e.g. arithmetic expressions, where afirst() or
second()` operand have more interface meaning.If there is a more actionable issue to address in form of code, please fe…