|
|
|
|
|
by kazinator
724 days ago
|
|
I had a bug somewhere, so I selectively off some of the add expressions. They can be commented out with #; or by flipping add to list or identity to throw away the value. The add is something which pairs with build. Lisp doesn't have "bag-like" lists. For those times when they are helpful, we can have procedural list building syntax. The build macro creates an environment in which a number of operators like add that build up or otherwise operate on an implicit list. When the build form terminates, it returns the list. (Its sister buildn returns the last form like progn). In this function, I could just have used (push expr stack) because we don't care about the order; there would be no nreverse. That would be a better idea, actually. We could also add the strings to a table directly, like (set [h (join ...)] t). The hash table is built by the hash-list call. It associates the elements of the list with themselves, so if "a" occurs in the list, the key "a" is associated with value "a". |
|
the use of [] for indexing rather than clojure's list building (or as conventional superparentheses) is appealing
what does buildn do with the built list?