[Oz] Generating lists of variables

Raphael Collet raph at info.ucl.ac.be
Tue Jul 11 13:55:18 CEST 2000


> --- Christian Schulte <schulte at ps.uni-sb.de> a écrit :
> 
> > 	{FD.distribute ff {List.foldR 
> >                        {Record.map Channel Record.toList}
> >                        Append nil}}
> 
> Using this instruction, I get the following error message:
> 
> %******************** Error: conditional failed *****************
> %**
> %** Missing else clause
> %**
> %** Matching: channel([_{1#8} _{4#11} _{7#14} _{10#17}
> _{13#20}] [_{1 2} _{4 5} _{7 8} _{10 11} _{13 14} _{16
> 17} _{19 20}] [_{1#14} _{4#17} _{7#20}] [_{1#14}
> _{4#17} _{7#17} _{10#17} _{13#20}])
> %** in file
> "/home/schulte/devel/mozart/share/lib/base/List.oz",
> line 97
> %**
> %** Call Stack:
> %** procedure 'FoldR' in file
> "/home/schulte/devel/mozart/share/lib/base/List.oz",
> line 94, column 0, PC = 1873728
> %**--------------------------------------------------------------
> 
> Now, I would be willing to bet that the suggested
> distribution method is valid, so the problem must be
> elsewhere. What could cause such an error message?

You are right.  The problem is that List.foldR is applied to a *record*.
Simply use Record.foldR instead of List.foldR:

	{FD.distribute ff {Record.foldR 
			   {Record.map Channel Record.toList}
			   Append nil}}

This should work.

--
Raphaël Collet
raph at info.ucl.ac.be
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list