guile-user
[Top][All Lists]
Advanced

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

Re: Me no understand scoping


From: Clinton Ebadi
Subject: Re: Me no understand scoping
Date: Thu, 31 Jul 2008 19:48:47 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

"Maciek Godek" <address@hidden> writes:

> Neil Jerram <address@hidden>:
>
>>> How to achieve this effect without using eval?
>>> (I've tried (+ . l) but it didn't work out)
>>
>> (apply + l)
>
> Correct :)
> Here comes another one:
> Suppose I want to define a variable, but I don't know its name
> -- it is contained in another variable. For example:
> (define a 'b)
> I want to assign a value to the symbol "contained" in a.
> (that would be b in this example). The problem is that "define"
> quotes its first argument. How to achieve it?

module-define! MODULE NAME VALUE

e.g. 
(let ((foo 'bar))
 (module-define! (current-module) foo 5)
 bar)
=> 5

Issue: this will be a top level binding, but a solution using `eval'
would also produce a top level binding (as it executes there to allow
lexical environments to be optimized...).

Doing such things, however, is fairly unschemey.

-- 
emacsen: every copy of Emacs comes with a bag of pot and 5 hits of acid
emacsen: and a hotel coffee maker




reply via email to

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