[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: session macros
From: |
Han-Wen Nienhuys |
Subject: |
Re: session macros |
Date: |
Wed, 29 Jan 2020 00:09:10 +0100 |
On Mon, Jan 27, 2020 at 11:33 AM David Kastrup <address@hidden> wrote:
> >
> > When calling the macro twice, we'll define add-session-variable twice,
> > which seems fishy.
>
> I think you got confused here. A macro is just an ordinary function on
> its inside, it only differs in its calling conventions during
> evaluation: instead of evaluating its arguments and calling the function
> body like with ordinary functions, it is called with unevaluated
> arguments and the result is then evaluated in its expression.
>
> add-session-variable is a local function defined inside of
> define-session. The effect is that it is not callable externally, and
> not modifiable externally. It is just putting stuff near to where it is
> being used (it is used as a function in the expansion of the macro).
>
> define-session is a macro since its use parallels the use of define ,
> and the first argument of define is the symbol to be defined which must
> not be evaluated before define-session is being called.
Thanks, I got it now. I sent a mail to the guile-devel list to
inquire what is going on.
--
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen