From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: If records are not sequences, why does aref work on records? Date: Fri, 7 Apr 2017 13:49:36 -0700 (PDT) Message-ID: References: <86pogo4vty.fsf@molnjunk.nocrew.org> <8360igof0k.fsf@gnu.org> <867f2w4qdk.fsf@molnjunk.nocrew.org> <0e6a0a16-8133-b2bc-404a-d0016f0c655e@cs.ucla.edu> <86h9202knq.fsf@molnjunk.nocrew.org> <4f2a1d4c-8703-4f07-a721-ea28c348631d@default> <864ly02i1m.fsf@molnjunk.nocrew.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1491598204 16504 195.159.176.226 (7 Apr 2017 20:50:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Apr 2017 20:50:04 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 07 22:50:00 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwapI-0002dI-NT for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2017 22:49:48 +0200 Original-Received: from localhost ([::1]:52519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwapO-00054I-HR for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2017 16:49:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwapH-000540-VQ for emacs-devel@gnu.org; Fri, 07 Apr 2017 16:49:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwapD-0001ew-1F for emacs-devel@gnu.org; Fri, 07 Apr 2017 16:49:48 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:45146) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cwapC-0001ep-OO for emacs-devel@gnu.org; Fri, 07 Apr 2017 16:49:42 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v37KnedF015121 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Apr 2017 20:49:41 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v37KneiA002733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Apr 2017 20:49:40 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v37KncSi013200; Fri, 7 Apr 2017 20:49:39 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:213783 Archived-At: > > If we decide to support aref or copy-sequence on records for > > efficiency or backwards compatibility that doesn't mean we want them > > to be full sequences. >=20 > FWIW, I agree. I think we do need aref and copy-sequence to work on > them, for backward compatibility reasons, but `sequencep` should > return nil. If such an approach is taken, with `copy-sequence' repurposed instead of having a new function to do the job, then its doc will need to be changed, to clarify that the arg and the result are not necessarily sequences. I don't know why we would want to pollute it that way. Let `copy-sequence' be a sequence function. I don't understand the backward-compatibility argument. A record type has not existed before. When/where do we already have `aref'/`copy-sequence' being applied to something other than a sequence/array? Oh, I see. Someone long ago let `aref' apply to byte code. Too bad. But what about `copy-sequence' - what backward compatibility is involved there? And why does `aref' apply to byte code? Should byte code perhaps be deemed an array (satisfy `arrayp')? Or should we add a new function for byte code, to replace the use of `aref' - and deprecate the latter? Seems like `aref', just as for Common Lisp, should apply only to an array.