Terrence Brannon wrote [to mdb-users]:
On Sat, Jul 31, 2010 at 5:57 PM, Darren Duncan <dar...@darrenduncan.net> wrote:
The primary reason for this change is to let user code be simpler,
because for the majority of the times when they just want to have 2
arguments for a function, they can supply them directly rather than
having to construct a set/array/bag/etc containing them, as N-adic
versions require.
I think most people are following your work at a much more general level
of detail than you and we are also much less familiar with the language
itself.
Yes. And so, when I describe changes, I also tend to describe the way things
were before the change, as a point of contrast.
So, how the N-adic call would currently differ from the dyadic call
would interest me.
Using the generic function call syntax that all user-defined and system-defined
operators can or sometimes must use, the difference is like the following ...
Dyadic:
is_identical( foo, bar ) # aka is_identical( topic => foo, other => bar )
diff( subtrahend => 53, minuend => 22 )
N-adic:
sum( {53,22,-34} ) # aka sum( topic => {53,22,-34} )
catenate( ['hello', ' ', 'world'] ) # aka catenate( topic => Array:['hello',
' ', 'world'] )
Note that all parameters are named, but for built-in functions with just 1
parameter or any functions with one or more parameters whose parameter names are
'topic' and 'other', arguments to those parameters can be given without names.
The desugared forms only use names, and this restriction means that Muldis D
function calls can be parsed without knowing the signature of the callee.
The special syntax for common built-ins, or user-defined ops that implement
built-in virtuals ...
Dyadic:
foo = bar
53 - 22
N-adic:
53 + 22 + -34
'hello' ~ ' ' ~ 'world
The above 4 special syntax would parse into exactly the same de-sugared/abstract
system-catalog representation as the above 4 generic forms.
Now the proposed changes would only affect the N-adic versions. If sum/catenate
are changed to dyadic, they could look like this in function call form:
sum( sum( 53, 22 ), -34 )
catenate( catenate( 'hello', ' ' ), 'world' )
Or one uses the general reduction function like this (assuming 'reduction' is
made virtual and uses an identity value in the wrapped function defs):
reduction( func => <sum>(), {53, 22, -34} )
reduction( func => <catenate>(), ['hello', ' ', 'world'] )
Using the special syntax, you can both use the old form:
53 + 22 + -34
'hello' ~ ' ' ~ 'world
... which would parse to 2 nested dyadic calls like sum(sum(53,22),-34), or this
new form, which would parse to a reduction() wrapper:
[]+ {53, 22, -34}
[]~ ['hello', ' ', 'world']
This could be a generic form:
[]<myfunc>() ...
... for:
reduction( func => <myfunc>(), ... )
So I hope that answers your question.
Also maybe you should setup a posterous account so you can "blog" your
various changes and they end up in search engines and an archived
chronological weblog?
I'm not generally interested in operating a blog, yet, but this mdb-users email
list is web-archived now in 3 different places (that I know of), which search
engines should be able to see. They are:
1. http://mm.darrenduncan.net/pipermail/muldis-db-users/
2. http://dir.gmane.org/gmane.comp.lang.muldisd.user
- and hence usenet in general, including Google's
3. http://www.mail-archive.com/muldis-db-users@mm.darrenduncan.net/
-- Darren Duncan
_______________________________________________
muldis-db-users mailing list
muldis-db-users@mm.darrenduncan.net
http://mm.darrenduncan.net/mailman/listinfo/muldis-db-users