One has to get used to that the two tuple-constructing operators '|' and '#' differ not only in what the name of the tuples they create is:

1|2|3 = '|'(1 '|'(2 3))  % note the right-associativity
1#2#3 = '#'(1 2 3)

Indeed, this may seem weird and incoherent at first, but is quite useful.

vQ



Raphael Collet wrote:
The '#' operator is multifix: 1#2#3 is expanded to the tuple '#'(1 2 3). To make it binary, you have to put parentheses...

    1#2#3 = '#'(1 2 3)
    (1#2)#3 = '#'('#'(1 2) 3)

It looks a bit weird at first, but it is very convenient!

Cheers,
raph

Terrence Brannon wrote:
Re: http://www.mozart-oz.org/documentation/tutorial/node3.html#chapter.basics

I've been staring at this sentence for 10 minutes, trying to simply
accept what it says, but it just does not make any sense to me:

   observe that 1#2#3 is a single tuple of three elements

But to my way of thinking, # is a binary operator and regardless of
associativity, it first creates a 2-tuple of two values and then
another 2-tuple nesting the first 2-tuple and the remaining element.

I really dont see how # could operate any other way, but would
appreciate any feedback on how this is possible.
_________________________________________________________________________________ mozart-users mailing list [email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

_________________________________________________________________________________ mozart-users mailing list [email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to