"Maciek Godek" <[EMAIL PROTECTED]> writes: > Neil Jerram <[EMAIL PROTECTED]>: > >>> 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