Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread John Cowan
On Thu, Apr 4, 2019 at 11:41 AM megane 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

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread felix . winkelmann
> > Once you give a fixed meaning, even by doing an optimization based > > on this meaning, users _will_ start to rely on it. At that stage it isn't > > undefined anymore. > > There's two ways I can think of getting warnings, then. > > a) Easy version. Randomly choose true or false at each if.

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread megane
megane writes: > felix.winkelm...@bevuta.com writes: > >>> >>> Nothing changes if we statically assign these values, the user still >>> cannot rely on undefined to be either true or false. >> >> Once you give a fixed meaning, even by doing an optimization based >> on this meaning, users _will_

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread megane
felix.winkelm...@bevuta.com writes: >> >> Nothing changes if we statically assign these values, the user still >> cannot rely on undefined to be either true or false. > > Once you give a fixed meaning, even by doing an optimization based > on this meaning, users _will_ start to rely on it. At

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread felix . winkelmann
> > Nothing changes if we statically assign these values, the user still > cannot rely on undefined to be either true or false. Once you give a fixed meaning, even by doing an optimization based on this meaning, users _will_ start to rely on it. At that stage it isn't undefined anymore. > >

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread megane
felix.winkelm...@bevuta.com writes: >> > No, but it could, depending on some arcane optimization that someone >> > may implement in the future (or not). It's simply open to the >> > implementation. >> > >> >> There's the possiblity of documenting this optimization: >> >> "If the expression's

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread felix . winkelmann
> > No, but it could, depending on some arcane optimization that someone > > may implement in the future (or not). It's simply open to the > > implementation. > > > > There's the possiblity of documenting this optimization: > > "If the expression's value can be determined statically to be

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread megane
megane writes: > felix.winkelm...@bevuta.com writes: > >>> >> Based on my limited observations (##core#undefined) will always have >>> >> the value 30L at runtime. This is not equal to 6L (or #f). Therefore >>> >> an undefined value in conditional test will always cause the true >>> >> branch

Re: [Chicken-hackers] Pessimizing undefined behavior

2019-04-04 Thread megane
felix.winkelm...@bevuta.com writes: >> >> Based on my limited observations (##core#undefined) will always have >> >> the value 30L at runtime. This is not equal to 6L (or #f). Therefore >> >> an undefined value in conditional test will always cause the true >> >> branch to be chosen. >> > >> >