unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Clinton Ebadi <clinton@unknownlamer.org>
To: "Pach Roman \(DGS-EC\/ESG3\)" <Roman.Pach@de.bosch.com>
Cc: guile-devel@gnu.org
Subject: Re: AW: define-syntax
Date: Tue, 09 Dec 2008 17:28:44 -0500	[thread overview]
Message-ID: <87skoxdlur.fsf@unknownlamer.org> (raw)
In-Reply-To: <3F715C67433E594B88B5ABEBBC6EE49F03E16E88@fe-mail47.de.bosch.com> (Pach Roman's message of "Tue, 9 Dec 2008 21:52:34 +0100")

"Pach Roman (DGS-EC/ESG3)" <Roman.Pach@de.bosch.com> writes:

>>> test 2:
>>> -------
>>> (define-macro (my-macro-2 par1 par2 par3)
>>>   (string-concatenate (list par1 par2 par3)))

A macro defined with define-macro is merely a function that is run at
macroexpansion time and is expected to return a new form for the
compiler. The body of the macro can perform arbitrary computation, and
your macro is actually calling string-concatenate at macroexpansion time
rather than returning the form as you expected.

(define-macro (my-macro-2 par1 par2 par3)
   `(string-concatenate (list ,par1 ,par2, par3)))

Will do what you expect.

-- 
                     How can you accept social supression                      
                      This weak state of mind in our time                      
                        I demand release from hypocrisy                        
                 I'd rather die than be held down, forced down                 




      parent reply	other threads:[~2008-12-09 22:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 16:51 define-syntax Pach Roman (DGS-EC/ESG3)
2008-12-09 20:20 ` define-syntax Neil Jerram
2008-12-09 20:52   ` AW: define-syntax Pach Roman (DGS-EC/ESG3)
2008-12-09 21:17     ` define-syntax Neil Jerram
2008-12-09 22:28     ` Clinton Ebadi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87skoxdlur.fsf@unknownlamer.org \
    --to=clinton@unknownlamer.org \
    --cc=Roman.Pach@de.bosch.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).