[Top][All Lists]

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

progv in scheme

From: Panicz Maciej Godek
Subject: progv in scheme
Date: Tue, 13 Sep 2011 15:54:03 +0200

Is there any clever way of binding values to the list of unknown
symbols in scheme?

In common lisp there is a form "progv" that takes the list of symbols
and their corresponding values and binds them within the body of

It is possible to do it using eval, like this:
(define (bind-and-eval symbols values body)
(eval `((lambda ,symbols ,body) . ,values)
(define-syntax let-symbols
(syntax-rules ()
  ((_ symbols values (body ...))
   (bind-and-eval symbols values (quote (body ...))))))

but using eval for this just seems too heavy. Is there any way of
doing it that would be more legal?

Best regards,

reply via email to

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