Carmack about static analysis

Timon Gehr timon.gehr at gmx.ch
Sun Dec 25 14:53:00 PST 2011


On 12/25/2011 02:44 PM, simendsjo wrote:
> On 25.12.2011 00:44, Timon Gehr wrote:
>>
>> Not really. Functional style code tends to be conceptually simpler.
>> Having code that is more readable can help. Getting rid of (({return
>> {return}}){return()}) makes the code more readable, whereas excessively
>> shortening identifiers does the opposite.
>>
>> See here for an example of what bearophile is talking about:
>> http://pastebin.com/2rEdx0RD
>
> r=cons(st(1UL),cons(st(1UL),lz({return zipWith((Lazy!ulong a,Lazy!ulong
> b){return lz({return a()+b();});},r,r().tail)();})));
>

http://pastebin.com/C6vf9DQQ

r=cons(st(cast(T)1),lz({return merge(merge(map((Lazy!T a){return 
lz({return 2*a();});},r),map((Lazy!T a){return lz({return 
3*a();});},r)),map((Lazy!T a){return lz({return 5*a();});},r))();}));

D'oh!


More information about the Digitalmars-d mailing list