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.7 required=5.0 tests=MAILTO_TO_SPAM_ADDR, 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id E27F2BC6B for ; Mon, 29 Oct 2007 22:34:21 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKfuJUfAXQImh2dsb2JhbACOXwEBAQgKKYET X-IronPort-AV: E=Sophos;i="4.21,344,1188770400"; d="scan'208";a="3803937" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 29 Oct 2007 22:34:21 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9TLYI4i018554 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 29 Oct 2007 22:34:21 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKfuJUdA6bjqnmdsb2JhbACOXwEBAQEHBAYRGIET X-IronPort-AV: E=Sophos;i="4.21,344,1188770400"; d="scan'208";a="18742690" Received: from wr-out-0506.google.com ([64.233.184.234]) by mail4-smtp-sop.national.inria.fr with ESMTP; 29 Oct 2007 22:34:20 +0100 Received: by wr-out-0506.google.com with SMTP id l58so976626wrl for ; Mon, 29 Oct 2007 14:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=2m1NEwuimj7V5CB6dquJRRatb+clSbnEVWS4AWXsE5M=; b=aqqh2Ice6X1ZugeF97BvB1Rmpg95Me2Rq7/muDRlNxymUQEPMGOx1VLepqW91I9yXlAi9pEyg8Tz+2E36h8Kc3MRy3OubUWdtY9q3XkJXkaWEvsIp9hWC1MeOXcYLUbLLzwu16+hOhV+x1VrNq17Jh6rP4yjT006vJkFruTlohc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=bGbZU9JImF4Mm3PGl6d9gIQr9YWWb6w2Efkfdp4wT9MsvxZtCgkUgQw57uTbfOkzymfmm+cKfgfOM2gBnLuFj5L7sAchkw1siUvP2AmwVKVpkulIseU/5X4mSM+XK/I+cf8PSrt5JuZly1WVyI0j9FutOdq3elkw/rkba4c9f70= Received: by 10.143.160.1 with SMTP id m1mr1542026wfo.1193693657120; Mon, 29 Oct 2007 14:34:17 -0700 (PDT) Received: by 10.143.168.5 with HTTP; Mon, 29 Oct 2007 14:34:17 -0700 (PDT) Message-ID: <9d3ec8300710291434v42fc071aj64e97d89d9129948@mail.gmail.com> Date: Mon, 29 Oct 2007 17:34:17 -0400 From: "Till Varoquaux" Reply-To: till.varoquaux@gmail.com Sender: till.varoquaux@gmail.com To: "Edgar Friendly" Subject: Re: [Caml-list] Patch to 3.10.0 compiler enabling simple spell-checking Cc: "Caml List" In-Reply-To: <47264C70.5050100@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47264C70.5050100@gmail.com> X-Google-Sender-Auth: 07941e4fc77c51bc X-Miltered: at discorde with ID 472651DA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; compiler:01 ocamlc:01 lablgtk:01 lablgtk:01 gtkinit:01 cmo:01 compiler:01 compilation:01 spellings:01 uncaught:01 yaron:01 minsky:01 beginner's:01 ocaml:01 bug:01 Cool! Haven't looked at the patch yet but this seems like a neat feature (might be a little too much of a gadget but,hey I love gadgets). I am curious. Why is this dedicated to Jane Street? Since I am probably the worst at typing out here (and even though they bought me a shiny shiny keyboard) I will take this patch as a personnal intention ;-). Till On 10/29/07, Edgar Friendly wrote: > One random little feature of GNAT that comes in handy for me is its > habit of, when I misspell an identifier, giving me a possible correction > in its compile error message. Spending some time with the 3.10.0 > sources, I have created a "second draft" patch creating this > functionality in my favored language. > > Example: > ======== > > # /home/thelema/Projects/ocaml-custom/bin/ocamlc -o coml -I +lablgtk2 > lablgtk.cma gtkInit.cmo coml.ml > File "coml.ml", line 61, characters 16-25: > Unbound value is_arcive, possible misspelling of is_archive > > Impacts: > ======== > > Efficiency in the case of finding a mistake should be quite good, > although this shouldn't matter too much since the compiler quits pretty > early in compilation when it finds an unbound identifier. > > In the case of no unbound identifiers, the cost is an extra try/with > block around the standard lookup. I haven't made any benchmarks, though. > > I expect this code to have little long term maintenance issues - the > major source of code changes was adding a "* string list" to a number of > exceptions to carry the list of possible correct spellings to the point > they get output by the compiler. These exceptions are still usable as > before with an empty list in this spot. > > It's possible the code has created opportunities for uncaught exceptions > in the compiler as I only checked for instances of "Not_found" in a few > files -- those which dealt with the Unbound_* exceptions. Someone who > knows the internals better might find places the "Found_nearly" > exception that carries possible corrections might escape into. > > > Dedicated to: > Yaron Minsky and the team at Jane Street > > E. > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > -- http://till-varoquaux.blogspot.com/