[haXe] Just a suggestion
Nicolas Cannasse
ncannasse at motion-twin.com
Thu Dec 6 17:05:40 CET 2007
edA-qa mort-ora-y a écrit :
> Nicolas Cannasse wrote:
>> My idea was to have an error when a value without side effect is 'lost',
>> meaning that it's not captured by any parent expression. That means that
>> all cases that currently make sense will not be forbidden by this change.
>
> Perhaps you could make this just a warning at first, otherwise I'm sure
> I have lots of code which would suffer from this error. (The old C
> pattern that functions with side-effects could nonetheless return a value.)
>
> Or, perhaps better, could you at the same time introduce a keyword
> called "ignore" which could always be assigned to, such as:
>
> ignore = a.funcWithReturn();
>
>
> Curious though, can you actually determine now whether a function/value
> has a side-effect or not?
All calls are presumed to have side effects, so only "values" are
concerned here.
Best,
Nicolas
More information about the Haxe
mailing list