chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] Pessimizing undefined behavior


From: John Cowan
Subject: Re: [Chicken-hackers] Pessimizing undefined behavior
Date: Thu, 4 Apr 2019 18:09:48 -0400



On Thu, Apr 4, 2019 at 11:41 AM megane <address@hidden> wrote:

The R5RS says (1.3.2) that the value of an _expression_ with undefined
(actually "unspecified") value has to be a valid scheme value
("object"), and it's up to the implementation what that value is.

That's true.  But a violation of syntax, which (begin) is, is what the
RnRS calls "an error", which is the same as "undefined behavior"
in other standards.  The program can misbehave in arbitrary ways,
and in particular the compiler is free to reject such programs
(which amounts to a failure before the program starts to run).

This is the same case as (car 1) or (substring "abc" n (- n 1))
or (let ((x 10) (x 20) ) x) or in particular (if #t).
It is completely different from (set! x 32) which returns an
unspecified value, the case you describe above.

-- 
John Cowan          http://vrici.lojban.org/~cowan        address@hidden
Half the lies they tell about me are true.
        --Tallulah Bankhead, American actress


reply via email to

[Prev in Thread] Current Thread [Next in Thread]