It seems that it returns a single TUPLE{} for now.
Also JOIN{} = DEE returns the following error: ERROR: Operator 'OP_EQUALS(TUPLE {}, RELATION {}) RETURNS BOOLEAN' has not been defined.
Am I misunderstanding something here?
Shouldn't JOIN { } return DEE ?
Re: Shouldn't JOIN { } return DEE ?
The JOIN operator is overloaded to support both tuple join and relation join. As JOIN {} is ambiguous as to whether it means tuple join or relation join, it arbitrarily defaults to tuple join. Thus, the result of JOIN {} is TUPLE {}, so JOIN {} = TUPLE {} returns true, but JOIN {} = DEE fails because there is no definition for the '=' operator that permits comparing the tuple result of JOIN {} with the relation that is DEE.
Admittedly, this is perhaps a violation of the Principle of Least Surprise. I probably should make JOIN {} mean relation join.
Admittedly, this is perhaps a violation of the Principle of Least Surprise. I probably should make JOIN {} mean relation join.
Re: Shouldn't JOIN { } return DEE ?
Interresting. Thanks for the explanation.
For the record, I was actually reading Hugh's book because I use it, and Rel, with the students at the University of Louvain. The example, and expectation, comes from what's written in the book. In that context, I would certainly say that it's a violation of the Principle of Least Surprise.
For the record, I was actually reading Hugh's book because I use it, and Rel, with the students at the University of Louvain. The example, and expectation, comes from what's written in the book. In that context, I would certainly say that it's a violation of the Principle of Least Surprise.
Re: Shouldn't JOIN { } return DEE ?
I wasn't aware it contradicted Hugh's book. That makes it unquestionably a violation of the Principle of Least Surprise!
I've made an entry in my "to do" list to change this for the next update.
I've made an entry in my "to do" list to change this for the next update.
-
- Posts: 124
- Joined: Sat May 24, 2008 4:49 pm
Re: Shouldn't JOIN { } return DEE ?
Tutorial D grammar doesn't include <n-adic tuple join>, so JOIN { } has to be a relation join, yielding DEE. What about UNION { }? That has to be an <n-adic tuple union> because if it were a relation union it would need a heading to be specified.
But apparently Rel doesn't yet support UNION { }, which is indeed defined to yield TUP{ }. Another one for the to-do list?
Hugh
But apparently Rel doesn't yet support UNION { }, which is indeed defined to yield TUP{ }. Another one for the to-do list?
Hugh
-
- Posts: 124
- Joined: Sat May 24, 2008 4:49 pm
Re: Shouldn't JOIN { } return DEE ?
Further to my reply just posted, I've just come across the point in my book where n-adic tuple join is indeed defined. But we didn't even have that in TD/V1, so my book has been in error all this time. Deepest apologies!
Hugh
Hugh