[Semi OT] Language for Game Development talk

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 27 15:56:57 PDT 2014


On 9/27/2014 3:30 PM, bearophile wrote:
> Walter Bright:
>
>> * local functions with the same syntax as global functions
>>
>> * safety which defaults to off
>>
>> All of which D does right now.
>
> It could be nice to have a syntax like lambdas for small struct/class methods:
> https://issues.dlang.org/show_bug.cgi?id=7176
>
> struct Foo {
>      int bar(int x) pure { return x * x; }
> }
>
> Becomes something like::
>
> struct Foo {
>      int bar = (int x) pure => x * x;
> }

I see no gain from that syntax.


> Unwanted access of global variables is a common source of troubles in my code.
> Time ago I suggested an optional @outer() function annotation:
> https://d.puremagic.com/issues/show_bug.cgi?id=5007

I suggest using 'pure' and passing the globals you actually need as ref parameters.



More information about the Digitalmars-d mailing list