cormullion wrote:So the answer to many of your questions about the design of newLISP is going to be related to the way these criteria can be met.
Oh, yes, I must learn more about newlisp way. The problem is that I have too much previous mis-knowledge: I am fluent in both traditional scripting languages (perl, python) and traditional lisp (scheme), but newlisp is none of them. ;-) Right now I am converting some of my small python scripts to newlisp -- just to learn from experience. And I immediately found an usage for built-in
curry:
Code: Select all
(map (curry format markup) cookies)
Good it is!
But now another question arises: why
find-all, when nothing is found, returns
nil and not empty list? I believe that this special case is not special enough: parse a line into tokens is a common pattern, and empty line is a common case in this pattern. In current state I must write:
Code: Select all
(dolist (word (or (find-all {pattern} (current-line)) '())) ...)
...and this seems awful. On the other hand, if you really want to check for "no match",
'() serves as boolean as well as
nil. Or I am missing something important again?