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
Patch to 3.10.0 compiler enabling simple spell-checking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Till Varoquaux <tvaroquaux@j...>
Subject: Re: [Caml-list] Patch to 3.10.0 compiler enabling simple spell-checking

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 ;-).


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
> File "", 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:
> Archives:
> Beginner's list:
> Bug reports: