guile-user
[Top][All Lists]
Advanced

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

Re: loop translations (was: Re: language translator help)


From: Eric E Moore
Subject: Re: loop translations (was: Re: language translator help)
Date: Tue, 30 Apr 2002 16:07:38 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.2

Eric E Moore <address@hidden> writes:

> Basically there needs to be a plain identifier before them, that needs
> to appear before the corresponding ... in the replacement.  Rather
> than thinking of the pattern think of the pattern <something> ... 

This isn't *quite* right, you can have other things besides a plain
identifier, but there still needs to be something before the ... that
contains pattern variables from the pattern.  So you can do:

(define-syntax append-one
  (syntax-rules ()
    ((append-one (form ...) ...)
     (begin
       (form ... 1) ...))))

Which will append 1 to all the forms in the append-one clause, such that:

(append-one (set! x) (+ x 3))

will expand to:

(begin 
  (set! x 1)
  (+ x 3 1))

and have the value of 6.....

Still, my correction to your code is probably what you want :)

> The r5rs description is... less than transparant, I'll grant :)

This still applies ;)

-- 
Eric E. Moore

Attachment: pgpialVUFEndf.pgp
Description: PGP signature


reply via email to

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