Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Design advice
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-09-28 (22:01)
From: John Gerard Malecki <johnm@a...>
Subject: Re: [Caml-list] Design advice
This thread reminds me to ask if are there any guarantees for ordering
of variant types?  Although the implementation indicates that with

  type card = Number of int | Jack | Queen | King | Ace

Jack < Queen and Queen < King it also says that Ace < Number 0.  I can
see what is going on with the implementation.  I'm curious if there
are any ordering guarantees that I can take advantage of?  Since the
documentation is silent on this point I doubt it.

Oh, It does seems as if tuples, arrays and lists are always compared
"from left to right".  This can be handy when sorting multi-
dimensional data.  This seems like a "more natural" ordering than for
variants but, once again, can this ordering be guaranteed for all
ocaml programs?

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: