From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Gwozdziewycz Newsgroups: gmane.lisp.guile.user Subject: Re: progv in scheme Date: Tue, 13 Sep 2011 15:16:49 -0400 Message-ID: References: <20110913190704.M82579@ccrma.Stanford.EDU> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1315941420 4104 80.91.229.12 (13 Sep 2011 19:17:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2011 19:17:00 +0000 (UTC) Cc: guile-user@gnu.org To: Bill Schottstaedt Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Sep 13 21:16:56 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 1R3YTY-0002pN-1O for guile-user@m.gmane.org; Tue, 13 Sep 2011 21:16:56 +0200 Original-Received: from localhost ([::1]:57305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3YTX-0007OI-Im for guile-user@m.gmane.org; Tue, 13 Sep 2011 15:16:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:50489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3YTU-0007OB-1p for guile-user@gnu.org; Tue, 13 Sep 2011 15:16:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3YTS-0002om-S0 for guile-user@gnu.org; Tue, 13 Sep 2011 15:16:52 -0400 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:64674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3YTS-0002od-PG for guile-user@gnu.org; Tue, 13 Sep 2011 15:16:50 -0400 Original-Received: by ywe9 with SMTP id 9so864165ywe.0 for ; Tue, 13 Sep 2011 12:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=vgA9hlpa9qhzhhKoFoc40qiO8o/P9zcY/zV7Bj2aLPM=; b=nfkJUxAbcOVA66oxCiGsZ4h7UZs/pfrRrxkxT0kmk2DJPPsb1DC4QMc0mKNnNKarTl l07ljsboPNRrUPby42VFv0PT10+7QgrYohfahfSDuFhDPmhq/jqTyCAx/TxtJvHnopR7 CLiEKAxhsYLz/gGxQlecZw9is5+JlOHW/USRg= Original-Received: by 10.68.59.170 with SMTP id a10mr1983505pbr.345.1315941409775; Tue, 13 Sep 2011 12:16:49 -0700 (PDT) Original-Received: by 10.142.144.6 with HTTP; Tue, 13 Sep 2011 12:16:49 -0700 (PDT) In-Reply-To: <20110913190704.M82579@ccrma.Stanford.EDU> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.41 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:8788 Archived-At: On Tue, Sep 13, 2011 at 3:09 PM, Bill Schottstaedt wrote: > if lambda were applicable, this would work in both cases: > > (define-macro (progv vars vals . body) > =C2=A0`(apply (apply lambda ,vars ',body) ,vals)) > >> (let ((s '(one two)) (v '(1 2))) (progv s v (+ one two))) > 3 >> (progv '(one two) '(1 2) (+ one two)) > 3 > > (running a mystery scheme...) Bill- It seems as though this would work actually in many schemes that do incremental expansion of macros as part of their eval. If eval was written as such: (define (eval form env) (cond ((self-evaluating? form) form) ((variable? form) (lookup env (car form))) (... ((macro? form env) (eval (expand-macro (car form) (cdr form)) env)) ...)) Then it seems as though it'd work perfectly fine. I haven't been using guile very long, but it seems as though it's doing bytecode compilation, which makes the story a bit different. (I could totally be wrong of course) --=20 http://www.apgwoz.com