Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] productivity improvement
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: [Caml-list] Is this a bug?
There is a bug here: is it in:

 Objective Caml version 3.04+11 (2002-05-16)

or is it in my code:
 
in one module:

    | `TYP_none -> print_endline ("NONE DETECTED");
       0,"Unknown"
 
in another module:

       | `DCL_val t ->
          print_endline ("val " ^ id^ "[old] : " ^ string_of_typecode t);
          let t' = match t with | `TYP_none -> `TYP_var n | _ -> t in
          print_endline ("val " ^ id^"[new] : " ^ string_of_typecode t');

output (2 test cases):

val printv[old] : Unknown
NONE DETECTED
val printv[new] : Unknown
NONE DETECTED
val x[old] : Unknown
NONE DETECTED
val x[new] : Unknown


The code also fails if I replace the match t with |`TYP_none with
and if/then/else construction.

It looks like the constructor `TYP_none isn't equal to itself :-)

-- 
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850




-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners