[Larceny-users] Ticket 638

Derick Eddington derick.eddington at gmail.com
Tue Apr 21 07:21:46 EDT 2009


On Tue, 2009-04-21 at 00:04 -0700, Derick Eddington wrote:
> On Mon, 2009-04-20 at 22:04 -0400, Lynn Winebarger wrote:
> > This ticket is pretty interesting:
> > 
> >   % cat temp2.sps
> >   (import (for (rnrs) run expand)
> >           (rename (only (rnrs base) cons) (cons kons)))
> > 
> >   (free-identifier=? #'cons #'kons)
> >   % ./larceny --r6rs --program temp2.sps
> > 
> >   Syntax violation: invalid reference
> > 
> >   Attempt to use binding of cons in library (program~19XamJ~2) at
> >   invalid level -1.  Binding is only available at levels: 0 1 2

> > There are multiple issues:
> > 1) The syntax violation is getting triggered too early.  
> 
> How can you tell?
> 
> > There's an
> > echo of Will's complaint that R6RS requires compiling programs with
> > obvious errors to give error messages at run-time
> 
> That temp2.sps is being compiled and run in the same process, so how can
> you tell when the error is happening?  I think it probably actually is
> happening at expand-time.

I was wrong about that.  I wonder why the error isn't detected at
expand-time.  Does R6RS really require this type of error to be reported
at run-time?  E.g.:

$ cat temp2.sls 
(library (temp2)
  (export)
  (import (for (rnrs) run expand)
          (rename (only (rnrs base) cons) (cons kons)))
  (display "before\n")
  (write (free-identifier=? #'cons #'kons)) (newline))

$ larceny -err5rs
Larceny v0.97a4 (alpha test) (Apr 19 2009 17:48:52, precise:Linux:unified)
larceny.heap, built on Sun Apr 19 17:50:33 PDT 2009
ERR5RS mode (no libraries have been imported)

> (import (primitives compile-stale-libraries))

> (compile-stale-libraries)
Compiling temp2.sls
Autoloading (rnrs)
Autoloading (rnrs enums)
Autoloading (rnrs lists)
Autoloading (rnrs syntax-case)
Autoloading (rnrs conditions)
Autoloading (err5rs records procedural)
Autoloading (rnrs exceptions)
Autoloading (rnrs hashtables)
Autoloading (rnrs arithmetic bitwise)
Autoloading (rnrs programs)
Autoloading (rnrs files)
Autoloading (rnrs io ports)
Autoloading (larceny deprecated)
Autoloading (rnrs records syntactic)
Autoloading (rnrs records procedural)
Autoloading (rnrs control)
Autoloading (rnrs sorting)
Autoloading (rnrs bytevectors)
Autoloading (rnrs unicode)

> 
$ larceny -path . -err5rs
Larceny v0.97a4 (alpha test) (Apr 19 2009 17:48:52, precise:Linux:unified)
larceny.heap, built on Sun Apr 19 17:50:33 PDT 2009
ERR5RS mode (no libraries have been imported)

> (import (temp2))
Autoloading (temp2)
Autoloading (rnrs)
Autoloading (rnrs enums)
Autoloading (rnrs lists)
Autoloading (rnrs syntax-case)
Autoloading (rnrs conditions)
Autoloading (err5rs records procedural)
Autoloading (rnrs exceptions)
Autoloading (rnrs hashtables)
Autoloading (rnrs arithmetic bitwise)
Autoloading (rnrs programs)
Autoloading (rnrs files)
Autoloading (rnrs io ports)
Autoloading (larceny deprecated)
Autoloading (rnrs records syntactic)
Autoloading (rnrs records procedural)
Autoloading (rnrs control)
Autoloading (rnrs sorting)
Autoloading (rnrs bytevectors)
Autoloading (rnrs unicode)
before

Syntax violation: invalid reference

Attempt to use binding of cons in library (temp2) at invalid level -1.  Binding is only available at levels: 0 1 2

Form: cons

Trace: 



Error: unhandled condition:
Compound condition has these components: 
#<record &who>
    who : "invalid reference"
#<record &message>
    message : "Attempt to use binding of cons in library (temp2) at invalid level -1.  Binding is only available at levels: 0 1 2"
#<record &syntax>
    form : cons
    subform : #f

Entering debugger; type "?" for help.
debug> 



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




More information about the Larceny-users mailing list