From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA01989; Thu, 24 Oct 2002 14:27:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA01716 for ; Thu, 24 Oct 2002 14:27:11 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from athlon.baretta.com (host120-68.pool80116.interbusiness.it [80.116.68.120]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9OCRBD10725 for ; Thu, 24 Oct 2002 14:27:11 +0200 (MET DST) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by athlon.baretta.com (Postfix) with ESMTP id 5A11727250; Thu, 24 Oct 2002 14:38:13 +0200 (CEST) Message-ID: <3DB7E9B5.8020406@baretta.com> Date: Thu, 24 Oct 2002 14:38:13 +0200 From: Alessandro Baretta Organization: Baretta srl -- www.baretta.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: it, en MIME-Version: 1.0 To: Jacques Garrigue , Ocaml Subject: Re: [Caml-list] Again on pattern matching and strings References: <3DB73515.90705@baretta.com> <20021023235719.GA9170@cs.unibo.it> <3DB79CD7.6040600@baretta.com> <20021024170123O.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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/matching.ml, 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 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