On Fri, 2016-01-01 at 10:40 +0000, Kapps via Digitalmars-d wrote:
> […]
>
> Someone else can explain better / more correctly than me, but I
> believe the issue lies with opCmp and opEquals. You can make
> expressions like p.Name.equals("James") work (I believe using
> opDispatch), but because all you have is opEquals, you can't know
> if the user put in 'p.Name == "James"` or `p.Name != "James"`, as
> they both simply call opEquals. In order to do that, you would
> need things like opLessThan, opEquals, opNotEquals,
> opGreaterThan, etc, which would (with improper use or bugs) cause
> other issues, like a < b && a > b and a == b && a != b to be
> true, or a == b || a != b to be false.
>
> I'm also not certain how you could implement `p => p.Name ==
> "James" || p.Name == "Bob"`, but there might be a way? I think
> this is the gist of it, but I'm likely wrong on some aspects of
> this, so it would be good if someone else clarified..Hummm… so to put it another way, the D meta-object protocol is even more broken than that of Java: at least in Java there isn't even a pretence that you can create an internal DSL. This is very, very sad, I had not realized D was this broken. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected] 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
