[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @bind

From: Marius Vollmer
Subject: Re: @bind
Date: 28 Jul 2001 14:53:45 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Neil Jerram <address@hidden> writes:

> >>>>> "Marius" == Marius Vollmer <address@hidden> writes:
>     Marius> Does anyone know how address@hidden' is supposed to be used?
> I think it's connected with the emacs lisp support.

Yes.  Looking at the implementation, address@hidden' creates new global
variables in the current module, and puts values from the existing
lexical environment into them.  That lexical environment is not
checked for proper structure at all, so that

    (@bind (a) #t)

will segfault immediately when run on top-level.  It really seems like
it bit-rotted away.  I think I take the liberty and re-design it
completely.  Like so

    (@bind ((var val) ...) body ...)

will assign the `val's to the global variables named by `var's
(symbols), creating them if they don't exist, executes body, and then
restores the previous values of the `var's.  Additionally, whenever
control leaves body, the values of the `var's are saved and restored
when control returns.  It is an error when a symbol appears more than
once among the `var's.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]