[Larceny-users] Syntax violations need &syntax

Derick Eddington derick.eddington at gmail.com
Wed Mar 18 19:04:23 EDT 2009


On Wed, 2009-03-18 at 16:01 -0700, Derick Eddington wrote:
> Per R6RS 5.5 "Syntax violations", the below exceptions must have a
> condition with type &syntax.

These also:

> (library (L) (export x) (import (rnrs)) (define x 1))

> (show-ex (set! L:x 'oops)
           '(rnrs base)
           '(prefix (L) L:))

Syntax violation: set!

Directly or indirectly imported variable cannot be assigned

Subform: L:x

Form: (set! L:x 'oops)

Trace: 

  (set! L:x 'oops)

  (lambda () (set! L:x 'oops))

  ((lambda () (set! L:x 'oops)))

((#<record &error> ())
 (#<record &who> (syntax-violation))
 (#<record &message>
  ("set!: Directly or indirectly imported variable cannot be assigned"))
 (#<record &irritants> (((set! L:x 'oops) L:x))))

> 


> (call-with-output-file "/tmp/L.sls"
   (lambda (fop)
     (put-datum fop
                '(library (L)
                   (export (oops))
                   (import (rnrs))
                   (define oops 1)))))

> (show-ex (load "/tmp/L.sls")
           '(rnrs base)
           '(err5rs load))

Syntax violation: export

Invalid export set

Form: (oops)

Trace: 

((#<record &error> ())
 (#<record &who> (syntax-violation))
 (#<record &message>
  ("export: Invalid export set"))
 (#<record &irritants> (((oops)))))

> 


-- 
: Derick
----------------------------------------------------------------




More information about the Larceny-users mailing list