Hello,

Muldis D provides infix operators like the following for testing the membership of a value in a collection:

    in   | ∈ |
    !in  | ∉ | not-in
    has  | ∋ |
    !has | ∌ | not-has

There currently exist 6 distinct type-specific functions for each the 4 infix operators, whose parameter types are as follows:

    value     | collection
    ----------+-----------
    Tuple     | Relation
    Universal | Set
    Universal | Array
    Universal | Bag
    Universal | SPInterval
    Universal | MPInterval

Where you see "Universal", the typical usage is a scalar value, but it can in fact be any value at all, since collections may be nested in collections.

Now, generally speaking I intend to overload the 4 operators so that you can use the same syntax for all container types.

However, due to reasons of overlapping types plus differing semantics for the same inputs to different functions, the Tuple/Relation pair must have distinct syntax, though the other 5 can all have a shared syntax.

My first question for you is, should the Tuple/Relation option get the shorter syntax given above and a longer/alternate syntax be invented for the other 5 to share, or should the 5 share the above syntax and T/R use the invented?

My thought is for the 5 to share the above syntax and T/R get something like this instead:

    within  | %∈@ |
    !within | %∉@ | not-within
    holds   | @∋% |
    !holds  | @∌% | not-holds

My second question is whether you have any proposals for other in/has synonyms to use instead of within/holds, or the Unicode syntax, which read better.

Finally, I assume people would be using the 5 more often in code but would you agree or might you see people using the tuple membership test more often instead?

Note that SQL's "in" I believe corresponds to the T/R version if I'm not 
mistaken.

-- Darren Duncan

_______________________________________________
muldis-db-users mailing list
muldis-db-users@mm.darrenduncan.net
http://mm.darrenduncan.net/mailman/listinfo/muldis-db-users

Reply via email to