bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#51089: 28.0.60; Using read-symbol-shorthands (("-" . "foo-")) should


From: João Távora
Subject: bug#51089: 28.0.60; Using read-symbol-shorthands (("-" . "foo-")) shouldn't shadow the '-' symbol
Date: Fri, 08 Oct 2021 08:43:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Here's another idea: disallow the car from being a string that
> includes only punctuation characters.  WDYT?

That doesn't work, right?  That's precisely what we want to include in
dash.el.

    (("-" . "magnar-dash-"))


So that e.g. the existing 

    (defun -some ...)

in dash.el can be read as if it had been written:

    (defun magnar-dash-some ...)

Maybe you want to mean something else?  Maybe you mean "disallow the
thing to be renamed to include only punctuation characters?".

If so, then I think I agree.  it'd be just a generalization of what I
suggested.

>> (2) Another natural, more generic, way would be to demand that the
>> shorthand in the 'car's of the elements of read-symbol-shorthands is
>> strictly shorter then the form about to be renamed.  In lread.c, I think
>> it would amount to this:
>
> I don't think I like this artificial restriction.

I proposed and coded what I thought you had explicitly agreed with in

    https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00100.html

> I'm aware that you are convinced that's how this feature should be
> used, but hard-coding your personal opinions, not necessarily shared
> by others, in such a low-level code is something we should avoid, I
> think.  And that's besides the fact that this changes sensitive parts
> of Emacs on the release branch.

I have absolutely no idea what "personal opinions" you are referring to.

* If you're talking about the "shorthand being shorter than the
  longhand", I think I've said that's a matter of usual fact, and not even
  my opinion on how to use this.  But it's not 100% so, in the original
  posting of this bug I presented the below example use case I'd like the
  'cl-loop' to be used as 'loop': shorthand is longer there.

* If you're talking about something else, please clarify.

At any rate, shorthand/longhand size comparisons is NOT what's at stake
here.  In this proposal, what's at stake is to require the shorthand to
be "strictly shorter", rather than the current "of less or equal length"
than the thing being renamed (it's clear that the thing being renamed
can't be longer than the shorthand).

This solves the shadowing problem '-' but breaks the idea of using
cl-lib.el symbols without a prefix (someone had this idea early on, and
I think it's not unthinkable).  So this proposal added a mechanism to
re-allow that.

João





reply via email to

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