* use-syntax / transformer doc bugs
@ 2004-10-04 20:10 Andy Wingo
2004-12-22 16:00 ` Marius Vollmer
2005-01-09 23:35 ` Kevin Ryde
0 siblings, 2 replies; 4+ messages in thread
From: Andy Wingo @ 2004-10-04 20:10 UTC (permalink / raw)
Some bugs:
scm:eval-transformer was removed in HEAD without a corresponding
ChangeLog entry in ice-9. This is confusing when digging into history.
The documentation on module transformers and the "system transformer"
is a bit shaky. For one, there doesn't seem to be a system transformer
any more. Second, the purpose of the module transformer isn't well
documented; for example, it's always #f unless syncase is loaded
(afaict). One should note that it is for implementing alternate syntax
packages, notably syncase, but also including language translation. (Is
that right?)
It's not clear from the docs that what (use-syntax (foo bar)) actually
does is uses the (foo bar) module, then installs the procedure bound to
`bar' as (module-transformer (current-module)). That seems like a bit of
a hack, but whatever. It should be noted that the user should only call
`use-syntax' for a module that actually implements a transformer, not
for modules that just export syntax. Also, it should cross-reference to
the paragraph describing the idea of a syntax transformer.
(And why are #:export and #:export-syntax different if they don't act
differently?)
In guile 1.6.4, (define-module (foo) #:use-syntax (ice-9 syncase)) won't
work because of this in boot-9.scm:1756:
(case (car kws)
((#:use-module #:use-syntax)
[...]
(and (eq? (car kws) 'use-syntax)
This is fixed in HEAD, but it would be nice if we could
s/'use-syntax/#:use-syntax/ in the 1.6 branch. Although strictly
speaking it might introduce incompatibilities with existing programs.
You can always get around it with (use-syntax (ice-9 syncase)). It
should be noted somewhere, at least.
Regards,
--
Andy Wingo <wingo@pobox.com>
http://ambient.2y.net/wingo/
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: use-syntax / transformer doc bugs
2004-10-04 20:10 use-syntax / transformer doc bugs Andy Wingo
@ 2004-12-22 16:00 ` Marius Vollmer
2004-12-22 20:19 ` Rob Browning
2005-01-09 23:35 ` Kevin Ryde
1 sibling, 1 reply; 4+ messages in thread
From: Marius Vollmer @ 2004-12-22 16:00 UTC (permalink / raw)
Cc: guile-devel
Andy Wingo <wingo@pobox.com> writes:
> The documentation on module transformers and the "system transformer"
> is a bit shaky.
The whole module system is shaky, especially the interaction with
syntax-case. We need to clean it up in a big way, after 1.8. A basic
plan for what we want to end up with in the lower layers is in
workbook/compilation/new-model.text.
> It's not clear from the docs that what (use-syntax (foo bar)) actually
> does is uses the (foo bar) module, then installs the procedure bound to
> `bar' as (module-transformer (current-module)). That seems like a bit of
> a hack, but whatever.
Yes, that is quite hackish.
> It should be noted that the user should only call
> `use-syntax' for a module that actually implements a transformer, not
> for modules that just export syntax. Also, it should cross-reference to
> the paragraph describing the idea of a syntax transformer.
Do you have a concrete patch for this?
> In guile 1.6.4, (define-module (foo) #:use-syntax (ice-9 syncase)) won't
> work because of this in boot-9.scm:1756:
>
> (case (car kws)
> ((#:use-module #:use-syntax)
> [...]
> (and (eq? (car kws) 'use-syntax)
>
> This is fixed in HEAD, but it would be nice if we could
> s/'use-syntax/#:use-syntax/ in the 1.6 branch.
Yes, we should fix this in 1.6. Also, we need to
s/spec/interface-args/, right? Could you check this and make a patch?
Thanks!
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: use-syntax / transformer doc bugs
2004-12-22 16:00 ` Marius Vollmer
@ 2004-12-22 20:19 ` Rob Browning
0 siblings, 0 replies; 4+ messages in thread
From: Rob Browning @ 2004-12-22 20:19 UTC (permalink / raw)
Cc: guile-devel
Marius Vollmer <marius.vollmer@uni-dortmund.de> writes:
> Andy Wingo <wingo@pobox.com> writes:
>
>> The documentation on module transformers and the "system transformer"
>> is a bit shaky.
>
> The whole module system is shaky, especially the interaction with
> syntax-case. We need to clean it up in a big way, after 1.8. A basic
> plan for what we want to end up with in the lower layers is in
> workbook/compilation/new-model.text.
I'd also suggest that we may want to look at the decisions PLT has
made before we make any major changes. My impression is that they may
understand some of the compilation related issues better than many.
Aside from their docs, this paper also looks interesting, though I
haven't read it yet:
Composable and Compilable Macros: You Want it When?
http://citeseer.ist.psu.edu/flatt02composable.html
--
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: use-syntax / transformer doc bugs
2004-10-04 20:10 use-syntax / transformer doc bugs Andy Wingo
2004-12-22 16:00 ` Marius Vollmer
@ 2005-01-09 23:35 ` Kevin Ryde
1 sibling, 0 replies; 4+ messages in thread
From: Kevin Ryde @ 2005-01-09 23:35 UTC (permalink / raw)
Cc: guile-devel
Andy Wingo <wingo@pobox.com> writes:
>
> It's not clear from the docs that what (use-syntax (foo bar)) actually
> does is uses the (foo bar) module, then installs the procedure bound to
> `bar' as (module-transformer (current-module)). That seems like a bit of
> a hack, but whatever. It should be noted that the user should only call
> `use-syntax' for a module that actually implements a transformer, not
> for modules that just export syntax. Also, it should cross-reference to
> the paragraph describing the idea of a syntax transformer.
>
> (And why are #:export and #:export-syntax different if they don't act
> differently?)
I find the description of use-modules versus use-syntax pretty
unclear. I thought at one time I know what it meant, but now know
I've got no idea.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-01-09 23:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-04 20:10 use-syntax / transformer doc bugs Andy Wingo
2004-12-22 16:00 ` Marius Vollmer
2004-12-22 20:19 ` Rob Browning
2005-01-09 23:35 ` Kevin Ryde
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).