Hi Alex,
You surely know that the references show it by marking evaluated
> arguments with a quote, e.g.
>
> : (help 'case)
> ========================================
> (case 'any (any1 . prg1) (any2 . prg2) ..) -> any
> ...
>
> as opposed to
>
> : (help 'cond)
> ========================================
> (cond ('any1 . prg1) ('any2 . prg2) ..) -> any
> ...
>
Surely I have not fully understood this until now.
Some of my confusion may have come from thinking of quoted arguments as
*not* being initially evaluated,
i.e. A quoted list '(+ 1 2 3) is not evaluated, vs (+ 1 2 3), and thus not
always following 'when' args are evaluated.
It is a very powerful mechanism but it also makes for bugs that took me a
few moments to resolve.
For example.. When I replaced (pop 'Lst) in the code with (++ Lst) but
initially wrote (++ 'Lst) which led to infinite loops and segfaults.
A sharp scalpel. :)
> BTW, in the 'seek' example
>
> (seek '(((C)) (not (sp? C))) Lst)
>
> it may not be obvious that it uses destructuring bind. 'seek' always
> gets the full (rest)list as argument, so the example could also be
> written as
>
> (seek '((L) (not (sp? (car L)))) Lst)
>
The destructuring bind expression was not obvious. Very interesting. I have
been wondering how to write that.
: (de func ((A B)) (println A) (println B))
-> func
: (func '(1 2 3 4))
1
2
-> 2
:
Neat!
Thank you for the insights!
/Lindsay