* removal of `string-to-sequence'
@ 2012-10-03 4:59 Drew Adams
2012-10-03 7:48 ` Jambunathan K
2012-10-03 13:09 ` Stefan Monnier
0 siblings, 2 replies; 3+ messages in thread
From: Drew Adams @ 2012-10-03 4:59 UTC (permalink / raw
To: emacs-devel
I byte-compile my code in Emacs 20 and use the result in 20 and later releases.
Until now (the Windows binary that I picked up today), that has never been a
problem.
Naturally, old code cannot take advantage of newer features - but that is not
the point here. We have always said that code byte-compiled from an older
version will work in a newer one.
That's now broken. Case in point: `string-to-list'. It has always been a
defsubst, apparently. But its defsubst definition changed in Emacs 22.
Its definition before Emacs 22 was (string-to-sequence string 'list). In Emacs
22 you deprecated `string-to-sequence', and `string-to-list' became just (append
string nil). That change, in itself, is not a problem.
`string-to-sequence' continued to exist, so there was no problem with old
byte-compiled code. Now it's gone, however, so the code breaks. You removed
the defsubst target for code compiled prior to Emacs 22. That's not good.
What this means is that for byte-compiled code to work in both Emacs 20/21 and
later versions, users can no longer use `string-to-list'. They must change
their code to use (append STRING ()). (Or write their own
function/macro/defsubst.)
Likewise, for `string-to-vector' - they must now use (vconcat STRING).
This is not progress. It would not hurt Emacs to keep `string-to-sequence', so
that old byte-code continues to be respected. You need not document it or
advertize it, but you should keep it.
As a general rule, you should not remove code that is used by defsubsts. (And
as another general rule, it's good to avoid using defsubsts.)
Someone long ago thought that making defsubsts for `string-to-list' and
`string-to-vector' was a good idea. (And Emacs still does that.) And they
thought that the generic function `string-to-sequence' was a good idea too.
Someone later decided they were wrong about that second idea. I say, "Tough
luck." You should suck it up, take responsibility for that bad past decision,
and keep `string-to-sequence' for forward-compatibility from older releases.
Emacs is full of hysterical raisins. This one wouldn't hurt anyone.
There are lessons to be learned in this history. One of them is not to be so
quick to clear out the attic, tossing stuff that you think no one is using. It
is probably the case that no one is using `string-to-sequence', but you have to
look beyond that.
And please consider also being clear in NEWS about such a code-breaking change.
What you say now is not enough:
** Some obsolete functions, variables, and faces were removed:
*** `string-to-sequence' (use `string-to-list' or `string-to-vector').
The problem is not what to replace `string-to-sequence' with. I doubt that
anyone even uses `string-to-sequence'. But lots of people use the defsubst
`string-to-list' or `string-to-vector', and in older versions those expand at
byte-compile time to `string-to-sequence'.
That NEWS entry does not help users of older releases realize how to adapt their
code.
Most users will not even realize that `string-to-list is a defsubst, so they
will not understand why their code is breaking. They will likely not use
`string-to-sequence' in their code, so that NEWS blurb will appear to be
irrelevant to them.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: removal of `string-to-sequence'
2012-10-03 4:59 removal of `string-to-sequence' Drew Adams
@ 2012-10-03 7:48 ` Jambunathan K
2012-10-03 13:09 ` Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Jambunathan K @ 2012-10-03 7:48 UTC (permalink / raw
To: Drew Adams; +Cc: emacs-devel
[OT]
1. API breakage or user-incompatibility is not much of a big problem in
general AS WE MAKE THEM TO BE.
If it is one thing that FLOSS users learn or taught too quickly, it
is that there will be some brokenness in the packages that they use.
2. I appreciate that you put enormous efforts in maintaining your
package and seriously care about breakages.
Wrt (2),
I suggest that you run a small experiment. Experiment would involve you
going against current beliefs which is to have the packages remain
broken. Try this for sometime and monitor user-behaviour. Do they
complain etc. It is possible that the user ecosystem has changed in the
last decade, so it is worth running in this experiment anyways see what
your findings are.
Or
You should forward your complaints to emacs-bugs ONLY IF there is a user
complaint backing it. i.e., no pre-emptive complaining from your part.
[Context Switch]
Sometimes I wonder, that all your good packages or goodness in all those
packages should be absorbed in to vanilla Emacs. Once the changes are
absorbed, brokenness, if any, will SQUARELY and UNQUESTIONABLY rest on
Emacs maintainers. It remains a mystery why you aren't an active
committer to Emacs. May be your employer "word limits" your patches?
"Drew Adams" <drew.adams@oracle.com> writes:
> I byte-compile my code in Emacs 20 and use the result in 20 and later releases.
> Until now (the Windows binary that I picked up today), that has never been a
> problem.
>
> Naturally, old code cannot take advantage of newer features - but that is not
> the point here. We have always said that code byte-compiled from an older
> version will work in a newer one.
>
> That's now broken. Case in point: `string-to-list'. It has always been a
> defsubst, apparently. But its defsubst definition changed in Emacs 22.
>
> Its definition before Emacs 22 was (string-to-sequence string 'list). In Emacs
> 22 you deprecated `string-to-sequence', and `string-to-list' became just (append
> string nil). That change, in itself, is not a problem.
>
> `string-to-sequence' continued to exist, so there was no problem with old
> byte-compiled code. Now it's gone, however, so the code breaks. You removed
> the defsubst target for code compiled prior to Emacs 22. That's not good.
>
> What this means is that for byte-compiled code to work in both Emacs 20/21 and
> later versions, users can no longer use `string-to-list'. They must change
> their code to use (append STRING ()). (Or write their own
> function/macro/defsubst.)
>
> Likewise, for `string-to-vector' - they must now use (vconcat STRING).
>
> This is not progress. It would not hurt Emacs to keep `string-to-sequence', so
> that old byte-code continues to be respected. You need not document it or
> advertize it, but you should keep it.
>
> As a general rule, you should not remove code that is used by defsubsts. (And
> as another general rule, it's good to avoid using defsubsts.)
>
> Someone long ago thought that making defsubsts for `string-to-list' and
> `string-to-vector' was a good idea. (And Emacs still does that.) And they
> thought that the generic function `string-to-sequence' was a good idea too.
>
> Someone later decided they were wrong about that second idea. I say, "Tough
> luck." You should suck it up, take responsibility for that bad past decision,
> and keep `string-to-sequence' for forward-compatibility from older releases.
> Emacs is full of hysterical raisins. This one wouldn't hurt anyone.
>
> There are lessons to be learned in this history. One of them is not to be so
> quick to clear out the attic, tossing stuff that you think no one is using. It
> is probably the case that no one is using `string-to-sequence', but you have to
> look beyond that.
>
> And please consider also being clear in NEWS about such a code-breaking change.
> What you say now is not enough:
>
> ** Some obsolete functions, variables, and faces were removed:
> *** `string-to-sequence' (use `string-to-list' or `string-to-vector').
>
> The problem is not what to replace `string-to-sequence' with. I doubt that
> anyone even uses `string-to-sequence'. But lots of people use the defsubst
> `string-to-list' or `string-to-vector', and in older versions those expand at
> byte-compile time to `string-to-sequence'.
>
> That NEWS entry does not help users of older releases realize how to adapt their
> code.
>
> Most users will not even realize that `string-to-list is a defsubst, so they
> will not understand why their code is breaking. They will likely not use
> `string-to-sequence' in their code, so that NEWS blurb will appear to be
> irrelevant to them.
>
>
>
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: removal of `string-to-sequence'
2012-10-03 4:59 removal of `string-to-sequence' Drew Adams
2012-10-03 7:48 ` Jambunathan K
@ 2012-10-03 13:09 ` Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2012-10-03 13:09 UTC (permalink / raw
To: Drew Adams; +Cc: emacs-devel
> I byte-compile my code in Emacs 20 and use the result in 20 and later
> releases. Until now (the Windows binary that I picked up today), that
> has never been a problem.
We do not even try to be backward compatible with code written for
Emacs-21 (since all the features "obsolete since Emacs<22" are removed
from the trunk, except for time-to-seconds).
Byte-compiled or not doesn't make much of a difference in this respect.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-03 13:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 4:59 removal of `string-to-sequence' Drew Adams
2012-10-03 7:48 ` Jambunathan K
2012-10-03 13:09 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.