Modern C++ Lamentations
Walter Bright
newshound2 at digitalmars.com
Thu Jan 3 22:05:58 UTC 2019
On 1/3/2019 11:26 AM, Timon Gehr wrote:
> On 01.01.19 07:21, Walter Bright wrote:
>> On 12/31/2018 2:28 PM, Timon Gehr wrote:
>>> Welcome to D, where 'enum' means 'const', 'const' means 'readonly', 'lazy'
>>> means 'by name', 'assert' means 'assume' and 'real' does not mean 'real' (in
>>> fact, I really like the 'ireal' and 'creal' keywords, pity they are being
>>> phased out). :)
>>
>> D's "by name" are the template alias parameters.
>
> I think alias parameters are not "by name" they are something like "by symbol".
> ("by name" is a bit confusing of a name, the argument expression need not really
> have a "name".)
>
> The standard PL jargon is this:
>
> https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_name
> https://en.wikipedia.org/wiki/Lazy_evaluation
Thanks for the info. It seems the explanations are a little slippery, and D's
usage doesn't precisely fit.
For example, D's lazy parameters can be used to implement control structures, as
it says lazy evaluation is for, but then seems a bit ambiguous about whether the
lazy evaluation is done once or many times.
More information about the Digitalmars-d
mailing list