emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorth


From: João Távora
Subject: Re: Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorthands have landed on master)
Date: Tue, 28 Sep 2021 08:21:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Phil Sainty <psainty@orcon.net.nz> writes:

> This has probably been covered in earlier discussions (apologies for
> not being across those), but...
>
> Won't this break a ton of basic tooling for locating things, if the
> symbol in the file is not the actual symbol?

Yes, it will "break" tags, grep, etc and these "dumb" tools.  Depends
what you mean by "break", however.  As a means to find symbols, grep is
_already_ broken by the ability to be utilize both "foo" and "foobar" in
the source.  You simply accept that breakage almost blindly.  Even
smarter tools are "broken" by (intern (concat "foo" "bar")) in that
sense.

I wouldn't give up the power of these indirections just to keep grep.
But indeed I have to be criterious when I use them.

As always, adding expressive power and indirection to a language
"breaks" anything that is too tightly coupled to the implementation.
For symbols, some tools make assumptions that they are always
represented textually by a certain contiguous string in a file.
Fortunately, some other tools don't, and IMO those are the most
important and valuable ones for dealing with symbols.

In these email discussions we use a namespace system, too.  We treat
each other by first names, like people normally do.  I don't type the
surnames of people unless they are explicitly participating in the
discussion.  With that I "break" the ability to grep for the exact
Stefan or Phil that I mean.  I can still grep for 'Stefan', or 'Sainty'
if I want.  It'll bring in some false positives.  But I wouldn't want to
give up the comfort of a first name basis.

So it sounds like you're arguing against namespaces in general, and
you're right, they have disadvantages, in any language.  But the
advantages are immense.  To organize complex problems utilizing many
libraries, I cannot imagine a decent language that does not have them.

João

PS: Do you know Xref and M-. ?  Added around Emacs 25, it's a tool that
uses a cross-referencing database that at least in principle shouldn't
make those assumptions.  It's actually based on a similar tool that I've
used in Common Lisp for many years (very complete namepsacing system),
and it's been fine.  I still use grep for the qualifying part of symbols
(the package, the Surname) and for the identifying part (the "first
name")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]