checkedint call removal

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 30 15:06:58 PDT 2014


On 07/30/2014 10:55 PM, Andrei Alexandrescu wrote:
> On 7/30/14, 11:31 AM, Timon Gehr wrote:
>> On 07/30/2014 07:56 PM, Andrei Alexandrescu wrote:
>>> On 7/30/14, 9:31 AM, Timon Gehr wrote:
>>>> 'lazy', which denotes pass by name instead of pass by need.
>>>
>>> It's not pass by name.
>>> ...
>>
>> How so? Is it about failure to allocate a closure?
>
> void fun(lazy int a) { ... }
> int x = 42;
> fun(x + 2);
>
> "x + 2" doesn't have a name.
> ...

You might just have been fooled by the name of a concept.

http://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_name


>>> Consider this: after considerable effort you are failing to explain your
>>> case for "assume" to the language creators.
>>
>> I think there was no such case (yet), only an unsuccessful attempt to
>> clear up a misunderstanding based on terminology.
>
> My perception is you were arguing for a very subtle distinction,

My perception is different. Why is this distinction so subtle?

> one that would hardly deserve a language feature.
> ...

version(assert) is a slight generalisation of such a language feature 
and it is already there. I already noted how the distinction can be 
implemented approximately in current D, in fact I think this was my 
first action in this thread.

version(assert) assert(...); // assert without effects on -release code 
generation.

This then runs into the 'funny naming' issue etc., but this would be 
going in circles.


More information about the Digitalmars-d mailing list