scymtym / architecture.builder-protocol

Protocol for flexible construction and traversal of results (e.g. ASTs in case of parsers)
GNU Lesser General Public License v3.0
8 stars 1 forks source link

In make-keyword-argument, handle base cases first #4

Closed robert-strandh closed 1 year ago

robert-strandh commented 1 year ago

The use of previous-cell and previous-updater as Boolean values, has the undesirable effect of handling the base cases after the "induction steps". Since it is best to handle base cases first, i.e., in the "then" branch of the IF, I recommend using (null previous-cell) and (null previous-updater) instead and reversing the "then" and "else" branches. It would improve the code in two ways. First, the base cases would be handled first, and second, it would be clear that these variables are not Booleans, so that NIL is not a false value, but a default value.