From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: progv in scheme Date: Tue, 13 Sep 2011 15:54:03 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1315922065 15860 80.91.229.12 (13 Sep 2011 13:54:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2011 13:54:25 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 13 15:54:19 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R3TRJ-0006Xr-Vu for guile-user@m.gmane.org; Tue, 13 Sep 2011 15:54:18 +0200 Original-Received: from localhost ([::1]:46836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3TRJ-0006Bk-9I for guile-user@m.gmane.org; Tue, 13 Sep 2011 09:54:17 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:49066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3TRC-00067b-S1 for guile-user@gnu.org; Tue, 13 Sep 2011 09:54:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3TR7-0004tP-Vy for guile-user@gnu.org; Tue, 13 Sep 2011 09:54:10 -0400 Original-Received: from mail-ew0-f52.google.com ([209.85.215.52]:38185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3TR7-0004t3-RL for guile-user@gnu.org; Tue, 13 Sep 2011 09:54:05 -0400 Original-Received: by ewy28 with SMTP id 28so420650ewy.39 for ; Tue, 13 Sep 2011 06:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=ll+H7aUKrQAPyqDVqv2cilb0F06k3OtA2BkTJ2V53M4=; b=WHsEXshXM5OiRMwVOpTAwiohwmOBiXSssFcfY7vidcSZBMUKDpzp+DB7CbjqhoQ+VD LkWwJHFa3pP7TsliFyEOrz86R4D0EpJUUOm1epJ2awW4PzqK7JJMSJCIY42IX3LcjA+5 qVhhWPRnk4mdr6Tb2Ku+QQxqYH9klghXPlLbA= Original-Received: by 10.52.69.166 with SMTP id f6mr3599276vdu.182.1315922043875; Tue, 13 Sep 2011 06:54:03 -0700 (PDT) Original-Received: by 10.220.188.3 with HTTP; Tue, 13 Sep 2011 06:54:03 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.215.52 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8777 Archived-At: 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.