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
[EMAIL PROTECTED] wrote:
local
Tail = [c o r n]
X
L = X|Tail
in
X = a
{Show L}
end
Please notice that
c | o | r | n
is not a list, but:
c | o | r | n | nil (== [c o r n])
is.
Cheers,
Jorge.
Selon Chris Rathman <[EMAIL PROTECTED]>:
In translating CTM, I've found chapter 9 on relational programming to be
a hard nut to crack. Before totally acquiescing, I've decided I need to
learn a lot more on Relational programming. I've started on another
book, in the hopes that it will help bridge my understanding. Or to put
a different spin on it - if you can't beat 'em, join 'em. Some initial
translations of "The Reasoned Schemer" into Oz can be found on Dominic
Fox's CTM website for any that care to provide me some feedback on my
translation choices.
http://www.codepoetics.com/wiki/index.php?title=Topics:TRS_in_other_languages:Oz
The immediate question I have has to do with unification on a list head
and tail. The rough translation of 2.21 to Oz is something along the
lines of:
local L X in
L.2 = c|o|r|n
L.1 = X
a = X
{Show L}
end
At the end, L should be a|c|o|r|n. My code above, however, causes the
program to enter a wait state (which I think I understand that the
unification on the tail requires that the head be known first). The
question is whether there's a way to work around this?
Thanks,
Chris Rathman
_________________________________________________________________________________
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