In order to do currying via C++ functions*), I might use something like an evaluator that evaluates an unbound symbol to itself. Is that possible?

Translated into Scheme code, it corresponds to defining say
  (define add (lambda (x) (lambda (y) (+ x y))))
by
  (define add1 (lambda (y) (+ x y)))
and then
  (define add (lambda (x) ...))
Thus in two separate steps, where the unbound symbol x in the first expression is bound only in the second.

I use now
scm_eval(scm_list_3(scm_sym_lambda, x, y), scm_interaction_environment())
where x is a list of symbols and y an expression.

  Hans

*) See the code at http://math.su.se/~haberg/guile/




Reply via email to