Alex,
Thanks for the write-up! It's fun to dissect the different versions with
'debug' and mess around at the repl.
> An alternative could be
>
>(de mapeach "Args"
> (mapcar
> (cons (cons (car "Args")) (cddr "Args"))
> (eval (cadr "Args")) ) )
>
> The 'cons'es are a l
> An even more "cute" solution would be if we could avoid the parameter
> argument completely.
>
> The natural way for this in PicoLisp is the implied parameter '@'.
>
> We might define
>
>(de map@ "Args"
> (mapcar
> '(("E") (and "E" (run (cdr "Args" # 'and' sets '@'
>
On Sat, Jul 18, 2015 at 11:37:02PM -0500, Erik Gustafson wrote:
> > We might define
> > ...
> > '(("E") (and "E" (run (cdr "Args" # 'and' sets '@'
> I love this! And you're right, it's even more cute. That's a really clever
> use of 'and'. Is that fairly common in PicoLisp code?
Yes