Short list with things to finish for D2

KennyTM~ kennytm at gmail.com
Thu Nov 19 13:35:04 PST 2009


On Nov 20, 09 05:26, Walter Bright wrote:
> aarti_pl wrote:
>> I know that quite a few people here doesn't like to allow users to
>> define their own operators, because it might obfuscate code. But it
>> doesn't have to be like this. Someone here already mentioned here that
>> it is not real problem for programs in C++. Good libraries don't abuse
>> this functionality.
>
> The problem with user defined operators is:
>
> 1. User defined tokens - mixes up lexing with semantic analysis
>
> 2. User defined syntax - mixes up parsing with semantic analysis
>
> and then we're in C++ land :-(
>
> Unless such have a unique grammar that can be lexed and parsed:
>
> a :string: b
>
> where string is the user defined name, so you can do things like:
>
> a :^^: b
>
> and define your own pow operator. The problem with this approach is the
> sheer ugliness of it.

a /pow/ b is already implementable...

Speaking of which, how to map opDiv_r into its opBinary!()() equivalent?



More information about the Digitalmars-d mailing list