guile-user
[Top][All Lists]
Advanced

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

Predicate of define-syntax


From: Hans Aberg
Subject: Predicate of define-syntax
Date: Sat, 8 Jan 2011 13:00:13 +0100

On 8 Jan 2011, at 00:22, Andreas Rottmann wrote:

If you are writing your own macro, I find 'define-syntax' easier:

It's not only easier, it also not inherently broken (as `define-macro'
is). See <http://en.wikipedia.org/wiki/Hygienic_macro> for a discussion
of the hygiene issue.

It seems that one cannot check that it is a macro, though. For some reason, they do not self-evaluate.


(macro? cond)
  ~> #t


(define-syntax def
  (syntax-rules ()
    ((def x ...)
      (define x ...))
))

(macro? def)
  ~> error





reply via email to

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