From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: removal of `string-to-sequence' Date: Tue, 2 Oct 2012 21:59:03 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1349240371 6016 80.91.229.3 (3 Oct 2012 04:59:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Oct 2012 04:59:31 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 03 06:59:36 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TJH3K-0007EY-K9 for ged-emacs-devel@m.gmane.org; Wed, 03 Oct 2012 06:59:22 +0200 Original-Received: from localhost ([::1]:34525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJH3F-0001as-3J for ged-emacs-devel@m.gmane.org; Wed, 03 Oct 2012 00:59:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJH3C-0001am-Pz for emacs-devel@gnu.org; Wed, 03 Oct 2012 00:59:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJH3B-00086k-BH for emacs-devel@gnu.org; Wed, 03 Oct 2012 00:59:14 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:49354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJH3B-00084d-4h for emacs-devel@gnu.org; Wed, 03 Oct 2012 00:59:13 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q934x9o1007743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Oct 2012 04:59:10 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q934x6vs009260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 3 Oct 2012 04:59:08 GMT Original-Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q934x5mQ002624 for ; Tue, 2 Oct 2012 23:59:06 -0500 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Oct 2012 21:59:05 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac2hI87YpBxMDhUdSCaWqZ2+xwU6bQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153978 Archived-At: 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.