[clean-list] constructor variable mistaken for uniqueness attribute

Erik Zuurbier EZuurbier@Abz.nl
Fri, 4 Apr 2003 10:07:20 +0200


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2FA81.374E03A0
Content-Type: text/plain

Hi all,

I defined a datatype for tries as follows:

:: Trie char meaning :== [Branche char meaning]
:: Branche char meaning = C char (Trie char meaning) | M meaning

and all went well: I defined all desired operations for tries. But then I
thought the choice of lists to represent the fan-out was too constrained:
for big alphabets look-up should be faster if instead of a list a binary
tree or whatever other tree-structure could be used.

So I thought: why not abstract out the particular list-type-constructor? So
I tried:

:: Trie c char meaning :== c (Branche c char meaning)
:: Branche c char meaning = C char (Trie c char meaning) | M meaning

But this generated the remarkable error message:

Error [TrieGen.icl,14,Trie]: c uniqueness attribute not allowed

What am I doing wrong?

Regards Erik Zuurbier

(By the way, this is Clean 1.3.2. If this problem does not occur in Clean
2.X, sorry for the fuss.)




------_=_NextPart_001_01C2FA81.374E03A0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">



constructor variable mistaken for uniqueness attribute



Hi all,

I defined a datatype for tries as = follows:

:: Trie char meaning :=3D=3D [Branche = char meaning]
:: Branche char meaning =3D C char = (Trie char meaning) | M meaning

and all went well: I defined all = desired operations for tries. But then I thought the choice of lists to = represent the fan-out was too constrained: for big alphabets look-up = should be faster if instead of a list a binary tree or whatever other = tree-structure could be used.

So I thought: why not abstract out the = particular list-type-constructor? So I tried:

:: Trie c char meaning :=3D=3D c = (Branche c char meaning)
:: Branche c char meaning =3D C char = (Trie c char meaning) | M meaning

But this generated the remarkable = error message:

Error [TrieGen.icl,14,Trie]: c = uniqueness attribute not allowed

What am I doing wrong?

Regards Erik Zuurbier

(By the way, this is Clean 1.3.2. If = this problem does not occur in Clean 2.X, sorry for the fuss.)



------_=_NextPart_001_01C2FA81.374E03A0--