[Larceny-users] using macros to handcode random walk in arbitrary dimension

Marijn Schouten (hkBst) hkBst at gentoo.org
Wed May 6 09:06:31 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Felix Klock wrote:
> Marijn (cc'ing larceny-users)-
> 
> On May 5, 2009, at 12:18 PM, Marijn Schouten (hkBst) wrote:
> 
>> I have written syntax-case macro code that should construct this
>> function for arbitrary dimension, except I cannot get it to work. I have
>> attached the complete program (68 lines) with the offending code
>> commented out.
> 
> It looks to me like you are invoking larceny in a manner where it will
> start up in its default mode which is an R5RS read-eval-print loop (plus
> some Larceny-specific extensions).
> 
> This default mode is different from Larceny's ERR5RS and R6RS modes.  In
> particular, there is *no* support for syntax-case in Larceny's default
> mode.
> 
> Would that explain the problems you are experiencing?

Ah, yes that would explain larceny's behavior.

> ----
> 
> You will have to decide whether you want to switch to running Larceny in
> a different mode (such as its ERR5RS mode), which will require some
> changes to your code, or if you want to switch to using Larceny's
> default macro system (where the only support for procedural macros is
> its explicit-renaming transformer macros [1]), which will require an
> entirely different set of changes to your code.

Thanks. So you're saying that ERR5RS mode supports syntax-case macros? How do I
enable it? The following doesn't work:

$ larceny -err5rs -- stripped-randomwalk.scm -e "(define pp pretty-print)" -e
"(main 10)" -e "(quit)"
Larceny v0.97a4 (alpha test) (Mar 13 2009 15:30:01, precise:Linux:unified)
ERROR detected during macro expansion:
Malformed syntax-rules
(lambda (stx) (syntax-case stx () ---


> -Felix
> 
> [1] 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

That seems to be only the first page of that article.

Thanks,

Marijn

- --
If you cannot read my mind, then listen to what I say.

Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML
<http://www.gentoo.org/proj/en/lisp/>, #gentoo-{lisp,ml} on FreeNode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoBi1YACgkQp/VmCx0OL2xU0wCeIURt8dtPlHS1sgUMh9C50pYc
DgsAniH7rKQktqyZS0jkYqbREw5Pkmhc
=F3ib
-----END PGP SIGNATURE-----



More information about the Larceny-users mailing list