On Fri, Feb 27, 2009 at 4:03 PM, Boriss Mejias <[email protected]>wrote:
> Raphael Collet wrote: > >> >> >> On Fri, Feb 27, 2009 at 3:07 PM, Oliver Mooney >> <[email protected]<mailto: >> [email protected]>> wrote: >> >> Sorry, in my original code the declared variables didn't match the >> function names. I've fixed that below: >> >> declare DiffListToList DiffListFromList >> >> fun {DiffListFromList L} >> case L >> of Elem|nil then Hole in Elem|Hole#Hole >> >> ^^^^^^^^^^^^^^^ >> The operator '#' has higher priority than '|'! Therefore the expression >> above does not return a pair, but an ill-defined list with a pair in one of >> its tails. Try (Elem|Hole)#Hole instead. >> > > That will not work because it will still put the pair with '#' at the end > of the list. The pair <list>#Hole has to be done at the beginning of the > recursion, as you did with the code below using Append. Ouch, stupid me! You're right. raph
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
