Hello,
I request your feedback on a change I was considering making in the syntax of
Muldis D for declaring library materials (database schema objects), such as
routines, types, constraints, stimulus-response-rules.
Materials are currently declared using syntaxes meant to resemble typical
programming languages.
The general syntax for declaring a named material is:
<material-kind> <declared-name> <material-payload>
For example:
function cube (Int <-- topic : Int) { topic exp 3 }
|<---->| |<>| |<--------------------------------->|
The general syntax for an anonymous material is exactly the same but for leaving
out the "declared-name" part.
A material meant to be public and declared directly under a public namespace
must be of the named variety. A material whose definition is embedded in
another one can be of either variety.
An embedded material that is a function can effectively be given a name in a
different way which is by binding it lexically to a named expression and
optionally afterwards assigning it to a variable, or using it as an argument to
another function call; a function used in this way is a higher-order function,
and Muldis D uses these frequently, such as in the general case of a "where"
(relational restriction) expression.
let cube ::= function (Int <-- topic : Int) { topic exp 3 }
In most places in Muldis D, the name of something appears first and all of its
details appear to its right, such as:
<declared-name> : <declared-type> # eg: var mycount : Int
<expr-name> ::= <expression> # eg: let myresult ::= 5 + myparam
<var-name> := <var-name> # eg: foo := bar
My question for you is, would it be reasonable to flip the kind and name around
for public material definitions as well, so that for example one might declare
the above function more like the second example than like the first? If I did
flip them around, it could serve so increase language self-consistency, maybe.
Or alternately, should I support both formats of declaring and let users use
what they want.
The actual syntax can differ of course; mainly I'm concerned with whether
something generally like this could be considered easy enough to use:
<declared-name> <material-kind> <material-payload>
Note that all materials have a shared (multi-level) namespace, so declaring
different kinds of materials in the same namespace will conflict if they have
the same declared names. Saying "function" say doesn't indicate a namespace but
rather says how to interpret what comes after the "cube".
I'm currently on the fence and probably wouldn't make the change barring more
advantages to doing so.
Thank you in advance for any feedback.
-- Darren Duncan
_______________________________________________
muldis-db-users mailing list
muldis-db-users@mm.darrenduncan.net
http://mm.darrenduncan.net/mailman/listinfo/muldis-db-users