unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* progv in scheme
@ 2011-09-13 13:54 Panicz Maciej Godek
  2011-09-13 14:25 ` Andrew Gwozdziewycz
  2011-09-13 17:57 ` Ian Price
  0 siblings, 2 replies; 14+ messages in thread
From: Panicz Maciej Godek @ 2011-09-13 13:54 UTC (permalink / raw)
  To: guile-user

Hello,
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
progv.

It is possible to do it using eval, like this:
(define (bind-and-eval symbols values body)
(eval `((lambda ,symbols ,body) . ,values)
      (interaction-environment)))
(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,
M.



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-09-15 18:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-13 13:54 progv in scheme Panicz Maciej Godek
2011-09-13 14:25 ` Andrew Gwozdziewycz
2011-09-13 14:26   ` Andrew Gwozdziewycz
2011-09-13 16:04   ` Panicz Maciej Godek
2011-09-13 16:35     ` Andrew Gwozdziewycz
2011-09-13 17:01       ` Bill Schottstaedt
2011-09-13 17:54       ` Bill Schottstaedt
2011-09-13 17:20     ` Ludovic Courtès
2011-09-13 17:57 ` Ian Price
2011-09-13 18:48   ` Panicz Maciej Godek
2011-09-13 19:09     ` Bill Schottstaedt
2011-09-13 19:16       ` Andrew Gwozdziewycz
2011-09-15 18:11       ` Andy Wingo
2011-09-15 18:16         ` Andrew Gwozdziewycz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).