From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 9F98BBC6B for ; Sat, 24 Feb 2007 00:39:53 +0100 (CET) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.187]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1NNdrlu032477 for ; Sat, 24 Feb 2007 00:39:53 +0100 Received: by nf-out-0910.google.com with SMTP id a27so1046805nfc for ; Fri, 23 Feb 2007 15:39:53 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ew3Fs3kQdiE1zGozGjEunFXuTatOFqTHFC/85rBCWhhm1Eg97gvIC0YCJSUa1P6qJMwKzRd4KrQR5WM/nuUblYcq+OFnZVSGIlwHpKocXzM9E4P/Y2qJaNrUv2E8Sg2oW4ZC9b6ycCUm1c8orxivHiSh313kHYLlkj0b+FwD9X4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ZxK5GqUzw5vPTAtVeP5iBQ6S4V3TBn8xYCmtgqddwAQYefB/ygBKI+g+DZ+L8UKDiclH+tDM89HiJrO7lHYEN1H2dexKbdSlWJ/yZlpzD7OyWebcWVLV6J3jftWrMBB+ICPLGs3kfNiiy7W0A1fkMosOkt996gkGhwkGe8Xsr/c= Received: by 10.82.113.6 with SMTP id l6mr969119buc.1172273992409; Fri, 23 Feb 2007 15:39:52 -0800 (PST) Received: by 10.82.100.16 with HTTP; Fri, 23 Feb 2007 15:39:52 -0800 (PST) Message-ID: Date: Sat, 24 Feb 2007 00:39:52 +0100 From: Tom To: "Jon Harrop" Subject: Re: [Caml-list] Case-insensitive lexing Cc: caml-list@yquem.inria.fr In-Reply-To: <200702232300.08359.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_60333_32624059.1172273992372" References: <23E977DC-77FF-44A2-8675-5EAA8F61505F@gmail.com> <20070224095152.a9669d3d.mle+ocaml@mega-nerd.com> <200702232300.08359.jon@ffconsultancy.com> X-j-chkmail-Score: MSGID : 45DF7B49.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45DF7B49.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lexing:01 hashtable:01 hash:01 ocaml:01 hashtable:01 hash:01 ocaml:01 caml-list:01 strings:01 strings:01 match:02 match:02 pattern:04 pattern:04 identifiers:04 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_60333_32624059.1172273992372 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline > > > > Moving all the keywords into a hashtable, and using that to > differentiate > > between keywords and identifiers actually works very well. > > I never understood why people use a hash table rather than a pattern match > in > OCaml. > Because, at least what I think, comparing strings using a hash-table is way faster than comparing them using pattern-matching. - Tom ------=_Part_60333_32624059.1172273992372 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline

> Moving all the keywords into a hashtable, and using that to differentiate
> between keywords and identifiers actually works very well.

I never understood why people use a hash table rather than a pattern match in
OCaml.

Because, at least what I think, comparing strings using a hash-table is way faster than comparing them using pattern-matching.

- Tom
------=_Part_60333_32624059.1172273992372--