[Larceny-users] Probably not a bug in R6RS, but...

David Rush kumoyuki at gmail.com
Mon Dec 15 05:57:38 EST 2008


So I've been using larceny as an over-amplified desk calculator while
doing some statistical program analyses and I got a little tired of
typing out LAMBDA all the time, so...

> (define-syntax \ (syntax-rules () ((\ v e0 e+ ...) (lambda v e0 e+ ...))))
\x20;

> (\ (a b) (+ a b))
#<PROCEDURE>

> ((\ (a b) (+ a b)) 2 3)
Error: Undefined global variable "b".
Entering debugger; type "?" for help.
debug> q

> (define-syntax \\ (syntax-rules () ((\\ v e0 e+ ...) (lambda v e0 e+ ...))))
\x5c;

> ((\\ (a b) (+ a b)) 2 3)
5

Which I guess is technically correct, but is rather surprising
nonetheless. Specifically, it is surprising that the REPL created a
procedure using the LAMBDA == \ substitution, but then it was unable
to apply it; whereas when using LAMBDA == L, everything worked just
fine.

And yes, I didn't *really* mean to make #\space into a symbol that was
equivalent to LAMBDA in the first place, but I still think that this
half-functional situation is odd. It looks like maybe there is some
interference with the lexer...

Should I report this as a bug?

david rush
--
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt



More information about the Larceny-users mailing list