[Larceny-users] R6RS in Larceny

Ray Racine rracine at adelphia.net
Sat Feb 10 00:10:23 EST 2007


This may not be news...

Andre Van Tonder released an extensively reworked version of his macro
system with R6RS support.  Modulo a couple of minor changes, it does
work in Larceny.  The result of an expand-file compiles as well. 

==========================

[ray at corwin theft]$ cat math.scm
(library (math)  
         (export add minus inc!)
         (import (for (r6rs) run expand))

         (define (add x y)
           (+ x y))

         (define (minus x y)
           (- x y))

         (define-syntax inc!
           (lambda (stx)
             (syntax-case stx ()
               [( _ x)
                (syntax
                 (let ((x1 (+ x 1)))
                   (set! x x1)
                   x1))]))))
          
[ray at corwin theft]$ cat mmain.scm
(import (r6rs) (math))

(define x 1)
(define y 2)
(display (minus (add (inc! x) y) 1))
(newline)
(display x)

===========================

[ray at corwin theft]$ rlwrap /code/petty/larceny_src/larceny
-heap /code/petty/larceny_src/avt.heap
Larceny v0.93.1 "(development)" (Jan 25 2007 10:35:31,
precise:Linux:unified)
larceny.heap, built on Thu Jan 25 10:36:18 EST 2007


> (r6rs-load "math.scm")

> (r6rs-load-program "mmain.scm")
3
2
> 





More information about the Larceny-users mailing list