From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.user Subject: Macro question (Guile define-macro) Date: Tue, 02 Mar 2004 21:22:09 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <87ishnc83y.fsf@ivanova.rotty.yi.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1078293478 18486 80.91.224.253 (3 Mar 2004 05:57:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Mar 2004 05:57:58 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Mar 03 06:57:52 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AyPOC-0007dp-00 for ; Wed, 03 Mar 2004 06:57:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AyOvA-0004xv-Bs for guile-user@m.gmane.org; Wed, 03 Mar 2004 00:27:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AyGQ3-0005mP-S1 for guile-user@gnu.org; Tue, 02 Mar 2004 15:23:11 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AyGPO-0005Ne-EG for guile-user@gnu.org; Tue, 02 Mar 2004 15:23:02 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.30) id 1AyGPN-0005NT-So for guile-user@gnu.org; Tue, 02 Mar 2004 15:22:30 -0500 Original-Received: (qmail 24303 invoked by uid 65534); 2 Mar 2004 20:22:25 -0000 Original-Received: from chello212186006140.401.14.univie.teleweb.at (EHLO garibaldi) (212.186.6.140) by mail.gmx.net (mp022) with SMTP; 02 Mar 2004 21:22:25 +0100 X-Authenticated: #3102804 Original-Received: from ivanova.rhinosaur.lan ([192.168.1.9] helo=ivanova) by garibaldi with esmtp (Exim 4.30) id 1AyGP6-0005gB-JA for guile-user@gnu.org; Tue, 02 Mar 2004 21:22:12 +0100 Original-Received: from andy by ivanova with local (Exim 4.30) id 1AyGP5-0001Yk-T8 for guile-user@gnu.org; Tue, 02 Mar 2004 21:22:11 +0100 Original-Newsgroups: comp.lang.scheme Original-To: Guile Users User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:mntt99/o+voSZqBHuLoKAFfX8bI= Posted-To: comp.lang.scheme X-Spam-Score: -4.9 (----) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.lisp.guile.user:2881 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2881 The following message is a courtesy copy of an article that has been posted to comp.lang.scheme as well. Hi! I have a macro problem. I want a macro call (condition (&a (b 1) (c 2)) (&x (y z))) expand into (%make-compound-condition-helper `((,&a (b 1) (c 2)) (,&x (y ,z)))) I now have the following, which does the job, but I don't like, since it uses "normal" list construction, while I'd like to have it in the more concise quasiquote notation: (define-macro (condition . forms) ;; forms: ((type1 (field1 value1) ...) ...) (list '%make-compound-condition-helper (list 'quasiquote (map (lambda (form) ;;(format #t "form ~S\n" form) (cons (list 'unquote (car form)) (map (lambda (entry) ;;(format #t "entry ~S\n" entry) (list (car entry) (list 'unquote (cadr entry)))) (cdr form)))) forms)))) Any help would be greatly appreciated. Thanks, Andy -- Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://yi.org/rotty | GnuPG Key: http://yi.org/rotty/gpg.asc Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62 Any technology not indistinguishable from magic is insufficiently advanced. -- Terry Pratchett _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user