Dear Fellow Sorceresses and Sorcerors,
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
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users