Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2539

Re: Spell checking identifiers

Path csiph.com!xmission!news.alt.net!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Newsgroups comp.compilers
Subject Re: Spell checking identifiers
Date Thu, 25 Jun 2020 21:44:45 +0800
Organization Easynews - www.easynews.com
Lines 35
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <20-06-018@comp.compilers> (permalink)
References <20-06-010@comp.compilers> <20-06-014@comp.compilers> <20-06-015@comp.compilers>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
Injection-Info gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="42191"; mail-complaints-to="abuse@iecc.com"
Keywords lex, errors
Posted-Date 25 Jun 2020 11:54:27 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
In-Reply-To <20-06-015@comp.compilers>
Content-Language en-GB
Xref csiph.com comp.compilers:2539

Show key headers only | View raw


On 25/06/2020 4:08 am, Thomas Koenig wrote:
> Kaz Kylheku <937-053-0959@kylheku.com> schrieb:
>> On 2020-06-23, Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
>>> 5 |     return j; // the variable, not the type.
>>>     |            ^ help: a local variable with a similar name exists: `i`
>
>> I don't find these kinds of childish diagnostic messages useful at all.
>>
>> They have started to appear in GCC also.
>
>> The good old "undeclared identifier `j`" requires no update, thanks.
>
> At least gcc doesn't do the suggestion in that particular case:
>
> foo.c: In function 'foo':
> foo.c:8:7: error: 'j' undeclared (first use in this function)
>      8 |     x[j] = a[i] > b[i];
>        |       ^
> foo.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
>

A friend showed me the ghc code for this, and it deliberatly (according
to comments) excludes single variable names.  I don't understand enough
Haskell to tell exactly what the code is doing, but they seem to be
using the Damerau-Levenshtein distance algorithm based on identifier
names.

Now, whether this is useful is of course debatable, and I would
personally like to give people a choice to either turn it on, or
off.  We can argue about defaults if/when I have a published
compiler.

--
Johann | email: invalid -> com | www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | twitter: @myrkraverk

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Spell checking identifiers Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-24 01:38 +0800
  Re: Spell checking identifiers Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-24 03:56 +0800
    Re: Spell checking identifiers gah4@u.washington.edu - 2020-06-23 16:51 -0700
      Re: Spell checking identifiers Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-25 22:33 +0800
  Re: Spell checking identifiers "Derek M. Jones" <derek@_NOSPAM_knosof.co.uk.invalid> - 2020-06-24 11:02 +0100
    Re: Spell checking identifiers gah4@u.washington.edu - 2020-06-24 18:28 -0700
      Re: Spell checking identifiers mac <acolvin@efunct.com> - 2020-07-09 16:07 +0000
        Re: Spell checking identifiers Thomas Koenig <tkoenig@netcologne.de> - 2020-07-10 07:12 +0000
          Re: Spell checking identifiers gah4@u.washington.edu - 2020-07-10 13:17 -0700
  Re: Spell checking identifiers Kaz Kylheku <937-053-0959@kylheku.com> - 2020-06-24 18:12 +0000
    Re: Spell checking identifiers Thomas Koenig <tkoenig@netcologne.de> - 2020-06-24 20:08 +0000
      Re: Spell checking identifiers Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2020-06-25 21:44 +0800
  Re: Spell checking identifiers gautier_niouzes@hotmail.com - 2020-06-24 13:08 -0700

csiph-web