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

Reply via email to