[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] Pessimizing undefined behavior
From: |
megane |
Subject: |
Re: [Chicken-hackers] Pessimizing undefined behavior |
Date: |
Thu, 04 Apr 2019 16:01:07 +0300 |
User-agent: |
mu4e 1.0; emacs 25.1.1 |
megane <address@hidden> writes:
> address@hidden 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.
>>> >
>>> > That's an implementation artefact, (begin) may also return #f, which would
>>> > be legal according to the standard. "Undefined" is not a value nor a type.
>>>
>>> You mean the compiler currently sometimes returns #f for (begin)?
>>
>> 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 undefined
> the value will be considered truthy. Otherwise the value can be
> anything, including false."
Maybe this is better:
"In conditionals an expression having an undefined value can be
considered either true or false. This may cause the true or false branch
to be dropped."
- [Chicken-hackers] Some undefined patches, megane, 2019/04/01
- Re: [Chicken-hackers] Some undefined patches, felix . winkelmann, 2019/04/01
- Re: [Chicken-hackers] Some undefined patches, megane, 2019/04/01
- [Chicken-hackers] Pessimizing undefined behavior, John Cowan, 2019/04/02
- Re: [Chicken-hackers] Pessimizing undefined behavior, megane, 2019/04/02
- Re: [Chicken-hackers] Pessimizing undefined behavior, felix . winkelmann, 2019/04/02
- Re: [Chicken-hackers] Pessimizing undefined behavior, John Cowan, 2019/04/02
- Re: [Chicken-hackers] Pessimizing undefined behavior, megane, 2019/04/02
- Re: [Chicken-hackers] Pessimizing undefined behavior, felix . winkelmann, 2019/04/02
- Re: [Chicken-hackers] Pessimizing undefined behavior, megane, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior,
megane <=
- Re: [Chicken-hackers] Pessimizing undefined behavior, felix . winkelmann, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior, megane, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior, John Cowan, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior, felix . winkelmann, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior, megane, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior, megane, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior, felix . winkelmann, 2019/04/04
- Re: [Chicken-hackers] Pessimizing undefined behavior, megane, 2019/04/05
- Re: [Chicken-hackers] Pessimizing undefined behavior, felix . winkelmann, 2019/04/02