Hi Jon,

> Why is the 'sys' function, which "returns or sets a system
> environment variable", listed in the "Control Flow" category? I
> expected to find it in the "System Functions" category.

Very true! That's better. I'll change it, many thanks!


> In the "System Functions" category I find the 'env' function, which
> doesn't seem to do anything related to environment variables. But

The meaning of "environment" here is not the _system_ environment (as
above), but the _Lisp_ environment, i.e. a set of variables and their
bindings.


> what is it good for? Not very clear to me. ;-)

It is quite useful in many situations.

You can manually build an environment, and pass it around (used, for
example, in the GUI implicitly (lib/form.l) to communicate data between
HTTP transactions, or explicitly to pass data to dialogs). You can build
functions with it (like in 'curry') or runtime contexts for 'job'
(similar to "continuations" in other languages, or to emulate the
behavior of coroutines), or 'bind'.

Also, you can get a snapshot of the current dynamic bindings, used e.g.
to log debug information (lib/app.l).

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
  • sys & env Jon Kleiser
    • Re: sys & env Alexander Burger

Reply via email to