Discussion:
[Larceny-users] Where is pretty-print hiding in ERR5RS?
Ryan Newton
2007-12-27 14:19:30 UTC
Permalink
It looks like pretty-print didn't make it into the R6RS standard
libs. Normal larceny (r5rs) has pretty-print bound at top-level, but
I haven't been able to figure out what library I need to import to get
pretty-print in ERR5RS mode.

Thanks,
-Ryan
Ryan Newton
2007-12-27 15:19:42 UTC
Permalink
Ditto for the 'time' macro!
Post by Ryan Newton
It looks like pretty-print didn't make it into the R6RS standard
libs. Normal larceny (r5rs) has pretty-print bound at top-level, but
I haven't been able to figure out what library I need to import to get
pretty-print in ERR5RS mode.
Thanks,
-Ryan
William D Clinger
2007-12-27 15:22:05 UTC
Permalink
Post by Ryan Newton
It looks like pretty-print didn't make it into the R6RS standard
libs. Normal larceny (r5rs) has pretty-print bound at top-level, but
I haven't been able to figure out what library I need to import to get
pretty-print in ERR5RS mode.
Any procedure that is present in Larceny's R5RS mode
(and not loaded dynamically using require or load) can
be imported using the following paradigm:

(import (primitives pretty-print
open-output-string
get-output-string))

A library's import declaration can use the primitives
clause also.

Despite R6RS prohibitions against syntactic extensions,
the primitives clause works in non-Spanky R6RS modes as
well as in ERR5RS mode; that's an advantage of being
R6RS-compatible but not R6RS-conforming.

Will
AndrevanTonder
2007-12-27 15:37:32 UTC
Permalink
Post by William D Clinger
Post by Ryan Newton
It looks like pretty-print didn't make it into the R6RS standard
libs. Normal larceny (r5rs) has pretty-print bound at top-level, but
I haven't been able to figure out what library I need to import to get
pretty-print in ERR5RS mode.
Any procedure that is present in Larceny's R5RS mode
(and not loaded dynamically using require or load) can
(import (primitives pretty-print
open-output-string
get-output-string))
A library's import declaration can use the primitives
clause also.
Note that "primitives" will not work for macros in general, most especially not
for macros that introduce bindings or that have syntax that does not
conform to the simple (rand rator ...) format. On the other
hand, it will work for non-binding macros that are of the (rand rator ..)
format, such as "time".

Andre
AndrevanTonder
2007-12-27 15:38:15 UTC
Permalink
Sorry, I meant (rator rand ...)

Andre
William D Clinger
2007-12-28 05:36:53 UTC
Permalink
Post by Ryan Newton
Ditto for the 'time' macro!
The time macro is defined by (larceny benchmarking),
which is missing from the Larceny User Manual's index
but is described at
http://larceny.ccs.neu.edu/doc/user-manual.html#LarcenyBenchmarkingSection

Will

Loading...