Is it possible to handle 'magic' property assignments a'la PHP?

Jacob Carlborg doob at me.com
Thu Jan 9 11:54:58 PST 2014


On 2014-01-09 18:57, H. S. Teoh wrote:

> I'm afraid that this might become ambiguous, for example:
>
> 	int* gun(...) {...}
>
> 	func (x==0)
> 		*gun(y);
>
> Does the second statement mean `func!(() => *gun(y))(x==0)`, or does it
> mean `func(x==0) * gun(y)`? While it's not hard to disambiguate this
> semantically, it means it's impossible to parse before you analyze it,
> which is probably a bad idea.

Right, probably not a good idea.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list