Spoke too soon - scratch that about ML. That's not the way it works. X::Y only works if Y is a list. You'd have to write 1::2::nil. (1::2 won't compile).

Which leaves me with the question: If 1|2 is not a list of [1 2], then what is it?

Thanks,
Chris Rathman

Chris Rathman wrote:
You did help clear up a misunderstanding I was having with the list constructors - I was thinking that [X Y] was a tuple constructor.

However, I was thinking that Oz uses the same sort of syntactic sugar as ML where X::Y is equivalent to X::Y::nil. So, I'm still under the impression that [X Y] is equivalent to X|Y in Oz (which is the same as X|Y|nil). Correct me if my understanding is wrong.

And speaking of tuples, how does one construct a tuple in Oz? (Probably not important for the Scheme translation, as lists are the data structure dujour.)

Thanks,
Chris Rathman



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

Reply via email to