On 7/30/14, 3:06 PM, Timon Gehr wrote:
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
Oh, yah. I'd forgotten. Mea culpa. Thanks!
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?
Because it created a long thread in which there's little agreement.
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.
Maybe this is a misundersanding. version(assert) does not mean "assert
is considered here, else it's completely ignored". It means "assert will
effect a run-time check".
Andrei