[Larceny-users] macros

William D Clinger will at ccs.neu.edu
Sat Sep 1 08:38:01 EDT 2007


Dan wrote:
> Well, I *do* want to compile files, just like I do in SISC and Chicken.

Sure.  In Larceny/x86, however, files are compiled
anyway when you load them, so the main motivation
for compiling files separately is to make them load
a lot faster.

> Is there a form to load only the macros from a file?

No.

> Alternatively, what's the preferred way to structure
> libraries that export both procedures and macros?

Isolate the macros into a separate file.  Load that
file from source.  The files that don't contain any
macros can be compiled using compile-file.

The next public release of Larceny is likely to have
some kind of support for loading R6RS libraries into
Larceny's R5RS top level.  That will become the new
preferred way to structure libraries in Larceny, but
it won't be as portable as the separate files unless
and until ERR5RS catches on [1].

> from searching the net I gather that larceny has more
> to offer than plain syntax-rules, but I can't find any
> documentation. Any place I can look? I'd be happy with
> either define-macro or syntax-case, neither of which
> seem to be available at the REPL...

Larceny supports low-level macros through explicit
renaming [2].  As an example of explicit renaming,
you might look at Lars Hanson's implementation of
defmacro [3].

The next public release of Larceny may support Andre
van Tonder's explicit renaming macros, which are an
improvement over Larceny's.  These macros would be
available only within R6RS libraries, but you will
be able to load those libraries into an R5RS top
level.

Will

[1] http://lists.scheme-punks.cyber-rush.org/pipermail/junta-scheme-punks.cyber-rush.org/2007-September/000123.html

[2] William D Clinger.  Hygienic macros through explicit
renaming.  In Lisp Pointers IV(4), 25-28, December 1991.
ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/prop/exrename.ps.gz

[3] http://larceny.ccs.neu.edu/larceny-trac/browser/trunk/larceny_src/lib/Standard/defmacro.sch

PS:  The next public release of Larceny will also
support Andre van Tonder's syntax-case, but only
within R6RS libraries blah blah blah.




More information about the Larceny-users mailing list