Discussion:
[Larceny-users] Undefined binding not detected, uses it somehow
Derick Eddington
2009-03-17 23:08:19 UTC
Permalink
Larceny v0.97a4 (alpha test) (Mar 17 2009 11:29:20, precise:Linux:unified)
larceny.heap, built on Tue Mar 17 11:33:15 PDT 2009
ERR5RS mode (no libraries have been imported)
(import (rnrs base))
(define (f x)
(unless (number? x)
(assertion-violation 'f "not a number" x))
(- x))
(f 1)
Error: unhandled condition:
Compound condition has these components:
#<record &assertion>
#<record &who>
who : f
#<record &message>
message : "not a number"
#<record &irritants>
irritants : (1)

Entering debugger; type "?" for help.
debug> q
(number? 1)
#t
(unless (number? 1) 'blah)
Error: Undefined global variable "unless".
Entering debugger; type "?" for help.
debug>
--
: Derick
----------------------------------------------------------------
Derick Eddington
2009-03-18 04:35:42 UTC
Permalink
I realized this probably isn't a bug. It's evaluating the call to
assertion-violation before the reference to unless. I usually realize
sooner when this is happening. Sorry. I've been getting used to
libraries and programs which detect unbound identifiers sooner.

P.S. I can't find the part(s) of R6RS which talk about procedure call
sub-expressions evaluation order (i.e., that it's unspecified); where is
it? Thanks.
--
: Derick
----------------------------------------------------------------
Post by Derick Eddington
Larceny v0.97a4 (alpha test) (Mar 17 2009 11:29:20, precise:Linux:unified)
larceny.heap, built on Tue Mar 17 11:33:15 PDT 2009
ERR5RS mode (no libraries have been imported)
(import (rnrs base))
(define (f x)
(unless (number? x)
(assertion-violation 'f "not a number" x))
(- x))
(f 1)
#<record &assertion>
#<record &who>
who : f
#<record &message>
message : "not a number"
#<record &irritants>
irritants : (1)
Entering debugger; type "?" for help.
debug> q
(number? 1)
#t
(unless (number? 1) 'blah)
Error: Undefined global variable "unless".
Entering debugger; type "?" for help.
debug>
Jon Wells
2009-03-18 04:40:55 UTC
Permalink
Page 28, second paragraph in the section titled "Procedure calls"...

When a procedure call is evaluated, the operator and
operand expressions are evaluated (in an unspecified or-
der) and the resulting procedure is passed the resulting
arguments.

jon.
Post by Derick Eddington
I realized this probably isn't a bug. It's evaluating the call to
assertion-violation before the reference to unless. I usually realize
sooner when this is happening. Sorry. I've been getting used to
libraries and programs which detect unbound identifiers sooner.
P.S. I can't find the part(s) of R6RS which talk about procedure call
sub-expressions evaluation order (i.e., that it's unspecified); where is
it? Thanks.
Derick Eddington
2009-03-18 05:43:19 UTC
Permalink
Thanks. I didn't guess it's in 9. Primitive syntax. I thought it would
be somewhere listed in the Contents with "procedure" in the name. Now I
see the section is referenced by the second index entry for "procedure
call", which I missed (I'll blame that on the HTML version). I note
R5RS has it in the "Procedure calls" section listed in the Contents.
--
: Derick
----------------------------------------------------------------
Post by Jon Wells
Page 28, second paragraph in the section titled "Procedure calls"...
When a procedure call is evaluated, the operator and
operand expressions are evaluated (in an unspecified or-
der) and the resulting procedure is passed the resulting
arguments.
jon.
Post by Derick Eddington
I realized this probably isn't a bug. It's evaluating the call to
assertion-violation before the reference to unless. I usually realize
sooner when this is happening. Sorry. I've been getting used to
libraries and programs which detect unbound identifiers sooner.
P.S. I can't find the part(s) of R6RS which talk about procedure call
sub-expressions evaluation order (i.e., that it's unspecified); where is
it? Thanks.
Continue reading on narkive:
Loading...