emacs-devel
[Top][All Lists]
Advanced

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

Re: removal of `string-to-sequence'


From: Jambunathan K
Subject: Re: removal of `string-to-sequence'
Date: Wed, 03 Oct 2012 13:18:32 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

[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" <address@hidden> 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.
>
>
>

--



reply via email to

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