Dear Fellow Sorceresses and Sorcerors,

Apparently, the text of the procedure that I had
cut-and-pasted from the online Tutorial of Oz became
garbled in the process, so I have manually typed it
below (my apologies for the inconvenience):

----- message follows immediately after this line
-----
Whilst perusing the runes of the online Tutorial of
Oz, the following seemingly obscure point of Section
5.7.1: "Functional Nesting" of the following SMerge
procedure (Figure 5.5) stymied me ( see
http://www.mozart-oz.org/documentation/tutorial/node5.html#label37
):

proc {SMerge Xs Ys Zs}
   case Xs#Ys
   of nil#Ys then Zs = Ys
   [] Xs#nil then Zs = Xs
   [] (X|Xr) # (Y|Yr) then
      if X =< Y then
         Zs = X|{SMerge Xr Ys}
      else Zr in
         Zs = Y|{SMerge Xs Yr}
      end
   end
end    

SMerge is declared as a procedure with the three
arguments Xs, Ys, and Zs, yet when invoked in the line

> Zs = X|{SMerge Xr Ys}

with only the two arguments Xr and Ys, no illegal
arity error is generated.  Why not?

May the powers that be shed light on this mystery.

Cheers,

Ben

----- message ends immediately before this line -----

Cheers,

Ben

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

Reply via email to