unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* defmacro* and defmacro*-public in master
@ 2009-12-15 17:15 Tristan Colgate
  2009-12-18 13:27 ` Tristan Colgate
  2009-12-28 11:05 ` Andy Wingo
  0 siblings, 2 replies; 3+ messages in thread
From: Tristan Colgate @ 2009-12-15 17:15 UTC (permalink / raw)
  To: guile-devel

Hi Guys,

  Are defmacro* and friends supposed to work in current master? I've
got some code that
works under 1.8 but fails on master. I checked the trivial examples in
the manual, and
sure enough, they fail as well...

scheme@(guile-user)> (use-modules (ice-9 optargs))
scheme@(guile-user)> (defmacro* transmorgify (a #:optional b)
...               (a 1))
ERROR: In procedure sc-expand:
ERROR: source expression failed to match any pattern in (defmacro*
transmorgify (a #:optional b) (a 1))
scheme@(guile-user)>

  Also, out of interest, is there such a thing as define*-syntax?

  And, whilst I'm at it, on a probably unrelated matter? Is it
possible to have docstrings for macros? It doesn't
seem unreasonable, but doing something like (help macroname) seems to
break anyway (for relatively obvious
reasons).

  Thanks very much for all the hard work you guys are putting in,

  Cheers

-- 
Tristan Colgate-McFarlane
----
  "You can get all your daily vitamins from 52 pints of guiness, and a
glass of milk"




^ permalink raw reply	[flat|nested] 3+ messages in thread

* defmacro* and defmacro*-public in master
  2009-12-15 17:15 defmacro* and defmacro*-public in master Tristan Colgate
@ 2009-12-18 13:27 ` Tristan Colgate
  2009-12-28 11:05 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Tristan Colgate @ 2009-12-18 13:27 UTC (permalink / raw)
  To: guile-devel

[I sent this before subscribing but it hasn't turned up so I'm resending now,
sorry if the previous posting reappears some time later]

Hi Guys,

 Are defmacro* and friends supposed to work in current master? I've
got some code that works under 1.8 but fails on master. I checked
the trivial examples in the manual, and sure enough, they fail as well...

scheme@(guile-user)> (use-modules (ice-9 optargs))
scheme@(guile-user)> (defmacro* transmorgify (a #:optional b)
...               (a 1))
ERROR: In procedure sc-expand:
ERROR: source expression failed to match any pattern in (defmacro*
transmorgify (a #:optional b) (a 1))
scheme@(guile-user)>

 None of the unit tests seem to directly cover these macros.

 Also, out of interest, is there such a thing as define*-syntax?

 And, whilst I'm at it, on a probably unrelated matter? Is it
possible to have docstrings for macros? It doesn't
seem unreasonable, but doing something like (help macroname) seems to
break anyway (for relatively obvious
reasons).

 Thanks very much for all the hard work you guys are putting in,

 Cheers

-- 
Tristan Colgate-McFarlane
----
  "You can get all your daily vitamins from 52 pints of guiness, and a
glass of milk"




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: defmacro* and defmacro*-public in master
  2009-12-15 17:15 defmacro* and defmacro*-public in master Tristan Colgate
  2009-12-18 13:27 ` Tristan Colgate
@ 2009-12-28 11:05 ` Andy Wingo
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2009-12-28 11:05 UTC (permalink / raw)
  To: Tristan Colgate; +Cc: guile-devel

Hi Tristan,

On Tue 15 Dec 2009 18:15, Tristan Colgate <tcolgate@gmail.com> writes:

>   Are defmacro* and friends supposed to work in current master?

Yes, they are. But indeed, they weren't working. Thanks for the report,
I have pushed a fix to current master.

>   Also, out of interest, is there such a thing as define*-syntax?

No, there is not; though you could build one.

>   Is it possible to have docstrings for macros?

Yes, macros can have docstrings. For defmacros, docstrings go in the
same place they would go if it were a function definition.

For syntax-case expressions, the docstring goes with the syntax
transformer:

  (define-syntax foo
    (lambda (x)
      "docs"
      (syntax-case x ....)))

Syntax-rules macros currently can't have any docs. We could change that,
but as it would be a nonstandard extension anyway, you're probably
better off using syntax-case.

> doing something like (help macroname) seems to break anyway

Ah, here you have found another bug, I think. I was going to add a
hack-around to (ice-9 documentation) to fix this, but it's probably
better to attack the root, in macros.c.

Cheers,

Andy
-- 
http://wingolog.org/




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-28 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 17:15 defmacro* and defmacro*-public in master Tristan Colgate
2009-12-18 13:27 ` Tristan Colgate
2009-12-28 11:05 ` Andy Wingo

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).