Browse thread
Patch to 3.10.0 compiler enabling simple spell-checking
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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 |
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 <thelema314@gmail.com> 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/