redunant match

brian <briand-/[email protected]> Tue, 5 Jun 2007 22:22:55 -0700
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
OK, once again I am stymied by the simplest of sml code

I have a datatype:

datatype ticStyle =  Inner | Outer | Both | None

I test the code on the command line:

datatype ticStyle = Both | Inner | None | Outer
- val a= Inner;
val a = Inner : ticStyle
- case a of Inner => "i" | Outer => "o" | Both => "b" | None => "n";
val it = "i" : string
-

In my code I have something that looks like:

   val ytic = case x_tic_style of
         Inner => "i"
       | Outer => "o"
       | Both => "b"
       | None => "n"

And I stop right there, because I get:

psgraph.sml:83.33-87.48 Error: match redundant
           Inner => ...
     -->   Outer => ...
     -->   Both => ...
     -->   None => ...

-

What was I doing wrong, easy I wasn't using the structure qualified  
name:

   Module.Inner
   Module.Outer

etc...

Why didn't I get an error related to the fact the Inner, Outer,  
etc... don't even exist as opposed to the wacky redundant error ?



Brian


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/