pureity of closures

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 22 14:21:59 PDT 2015


On Sun, 22 Mar 2015 19:38:52 +0000, Stefan Koch wrote:

> On Sunday, 22 March 2015 at 19:06:33 UTC, ketmar wrote:
>> hm. i missed this part (about dead code). compiler doesn't do "dead
>> nested function removal" before semantic analysis, afair, and attribute
>> inference is in semantic stage.
>>
>> yet you can cheat compiler by turning `impure_function()` to template.
>> attribute inference on templates are done when template is
>> instantiated,
>> and `impure_function()` is never instantiated.
> 
> I am implementing pure for sdc.
> The point is, I want to get it right.

i believe that both ways is right (i.e. both generating error and not 
generating error).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150322/3b3ff755/attachment-0001.sig>


More information about the Digitalmars-d mailing list