On 4 avr, 11:50, Jon Harrop <[EMAIL PROTECTED]> wrote: > Alas, that is impossible with OCaml's current design because it can't do > monomorphization. All the OCaml compiler ever sees is a completely > polymorphic: > > a = b > > and it has no idea that this will later be erroneously applied to an abstract > type as well as its correct applications to other types.
You cannot issue such a warning if you are using List.mem with an abstract datatype. However I think it can be done if the application of = is made on an abstract datatype in a monomorphic context (witness the specialisation done by ocaml for the comparison of ints). > What is "the bt"? The bugtracker. > Brevity also reduces the cognitive load. If you look at the OCaml equivalent > of "set [1 .. 1000]" it is clearly entirely superfluous piffle that does > nothing whatsoever to help the reader understand what is going on. Indeed, it > is *more* likely to be buggy. A little bit of it of course, too much of it no. A balancing act. > A triumph of hope over reality, I am afraid. Numeric types are often used in > conjuction, such as scalars, vectors and matrices. Note you are talking about something different. I was talking about using different scalar types in the same context. > The thread on the caml-list even detailed a complete example that does > exactly this for int and > int64 in an attempt to overcome some of OCaml's other problems. No in that thread he said he needs to use int64 he then wants operators for each the types but he doesn't say he wants to mix them. Daniel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ocaml-developer" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/ocaml-developer?hl=en For other OCaml forums, see http://caml.inria.fr/resources/forums.en.html -~----------~----~----~----~------~----~------~--~---
