My first thought at a lint implementation was simply "warn if a let-bound
name matches any Var name in clojure.core", although granted that could
produce more false positives than you want.

The linter could be enabled by default, and experienced folks could disable
it completely.

Alternately, when I get around to implementing source code annotations to
disable individual warnings, one could mark the ones that they know are ok,
but that could get more tedious than simply disabling the check globally.

Andy


On Wed, Jul 30, 2014 at 1:17 PM, Colin Fleming <colin.mailingl...@gmail.com>
wrote:

> Yeah, I do this all the time as well (in Cursive, I frequently have things
> with names like 'symbol' and 'list' for example), but it does bite me when
> I later refactor or copy some code around. I'm not sure what criteria I'd
> want used for this warning - attempting to invoke a local binding that had
> something clearly not invokable (string etc) assigned to it? It's tough
> though, very rarely do you have enough type information to make those
> decisions.
>
>
> On 30 July 2014 19:37, Sean Corfield <s...@corfield.org> wrote:
>
>> FWIW we have several places where the obvious local name shadows a core
>> function - so the existing behavior is both desirable (IMO) and in existing
>> production usage. I would not want to see that changed :)
>>
>> Eastwood seems like the correct place for this (Eastwood has continued to
>> detect bugs in our code and peculiarities - that are not bugs but should be
>> rewritten for clarity - so I'd heartily recommend it to everyone).
>>
>> Sean
>>
>> On Jul 30, 2014, at 10:32 AM, Andy Fingerhut <andy.finger...@gmail.com>
>> wrote:
>>
>> This would be an appropriate kind of check for a lint tool like Eastwood
>> to make, and warn about.  It currently does not do so, but I've created an
>> issue to remind me of the potential enhancement. [1]
>>
>> It is up to the Clojure core team to decide whether they would like to
>> make such a change to the Clojure compiler itself.  My guess is that since
>> this is legal Clojure code, and sometimes people do this in their code
>> intentionally (i.e. use let-bound names that happen to match Var names in
>> clojure.core and other namespaces), they might prefer _not_ to have the
>> compiler issue such a warning.  Note these words: "my guess".  I have no
>> inside knowledge here.
>>
>> Andy
>>
>> [1] https://github.com/jonase/eastwood/issues/81
>>
>>
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to