Proposal: Database Engine for D

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 1 03:30:45 PST 2016


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:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160101/9739e9aa/attachment.sig>


More information about the Digitalmars-d mailing list