lazy variables

Steven Schveighoffer schveiguy at gmail.com
Thu Oct 18 18:24:19 UTC 2018


On 10/18/18 12:11 PM, aliak wrote:
> On Thursday, 18 October 2018 at 14:11:36 UTC, Steven Schveighoffer wrote:
>>
>> Yes, but that's what lazy variables do.
>>
> 
> Not in Swift at least...

Apparently so (I have not used them before), but this is D! So you 
should be aware that lazy parameters work that way (the expression is 
evaluated each time the variable is used).

In any case, you can certainly create a Swift-like lazy variable and I 
think the other responses probably show you the way.

-Steve


More information about the Digitalmars-d-learn mailing list