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. I always have in mind that 'and' sets the value of '@' (like the
other functions in http://software-lab.de/doc/ref.html#atres under "Flow

A more traditional way would be

   '(("E") (let @ "E" (run (cdr "Args"))))

i.e. explicitly bind the symbol with 'let'.

But I obviously wasn't careful! Why make it so complicated? The "right"
way is of course:

   '((@) (run (cdr "Args")))

With that, the whole function is

   (de map@ "Args"
         '((@) (run (cdr "Args")))
         (eval (car "Args")) ) )

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to