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] Again on pattern matching and strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-24 (12:27)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] Again on pattern matching and strings

Jacques Garrigue wrote:

> That message was about polymorphic variants, which are encoded as
> integers, and for which pattern-matching is a decision tree.
> However, if you look in bytecomp/, you will see that string
> patterns are just checked sequentially (the ordering is not used).
> Moreover, the match compiler seems to be clever enough to compile
> properly the above style:...

Very strange. I thought the Ocaml compiler sould 
precalculate the branch of pattern matching to be taken, and 
then jump, thereby avoiding sequential checking. I'm sorry 
for my mistake.

Alex Baretta

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