I've always thought learning Lisp would be a good thing to do. The purists may argue that newLISP is not the best place to start. Oh well, too bad.
Below is my first (ever) lambda expression, a port of the VBScript RevInstr() function.
I must say I'm impressed with newLISP. Note that the minus (-) function above can receive more than one argument. A lot of the functions are like that.
Using the reverse-find is very like the (find) function, as below
One thing that differentiates my lambda expression from the in-built find, is in the manner in which an error is flagged.
I'm not sure at this point why the difference and what to do about it. In my use of (find) I check for a result equal to nil, but with (reverse-find) I have to check to see if the result is a string. For example,
Doubtless, someone in the newLISP Fan Club will set me straight soon.
© Copyright Bruce M. Axtens, 2009