From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: If records are not sequences, why does aref work on records? Date: Fri, 7 Apr 2017 15:07:31 -0400 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 X-Trace: blaine.gmane.org 1491592103 12134 195.159.176.226 (7 Apr 2017 19:08:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Apr 2017 19:08:23 +0000 (UTC) Cc: Lars Brinkhoff , Emacs developers To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 07 21:08:19 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 1cwZEy-0001RR-LE for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2017 21:08:12 +0200 Original-Received: from localhost ([::1]:52266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwZEz-0000Vs-JV for ged-emacs-devel@m.gmane.org; Fri, 07 Apr 2017 15:08:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwZEL-0000Va-Rv for emacs-devel@gnu.org; Fri, 07 Apr 2017 15:07:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwZEL-00025E-1B for emacs-devel@gnu.org; Fri, 07 Apr 2017 15:07:33 -0400 Original-Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:33788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cwZEK-00024z-ST for emacs-devel@gnu.org; Fri, 07 Apr 2017 15:07:32 -0400 Original-Received: by mail-oi0-x235.google.com with SMTP id b187so96586083oif.0 for ; Fri, 07 Apr 2017 12:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=a+Rj+SXfjejT4eZALXnD4kZyZiKoOCSKfcyV1S7ybdI=; b=f+H/FrADiSDaUfmoBZllyO9iApVcDCaRyPplEbsIEhwRBtQ8sLWSuoQkvaEceM7Bh4 CGeUqo5IdnJzGRz4iXQ3gXfs6Tr2QDkD8rjPf6helUJpPhIi849BslfL6nhD7mk6Itqx eMILCFhZgwI9UCZHFMtgj+4UIa+0taLHebYP359W9ynt7drEpl4TPEZnKDDchjNaACQF vwgt/7kcgPDXyJknSUWttDX8efIJAwuFyF3F14fskxRotHp3DtXXXzOoVpRO2FnAV5mF U7d+xDt+OMOCT3nj//N8c+pE25Kjy8LKPkoUJgd1Gecrcy7CiEZ6RtcHV87nH31gq88j MJ2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=a+Rj+SXfjejT4eZALXnD4kZyZiKoOCSKfcyV1S7ybdI=; b=dQY+JXNXWpLMkLVs7778wtaGOBnWaN0up/LdITpxHdWUeek62r0STg2oPbJk+Z8v0l K/tEHS5UWXuV00jrCD3XSQidNdMD4g7mSo74EgpNb8ZPTKyVYPCAT1+c6cqXpXjhV+0o GJfOOXPjQv+rr4wijdt1X8ZiDQseE+Jne755bDZ0h5dOzK1YQ+HR/+HqA6oeGj2ITk6G 62QJP9ieW1GLCbKJLrkj2K6EsxF42QnojvbNDJ1TGUq9Mk955PvJ8uUpA90Jk8R3e5eo QhCXe5/M+5rJyx1ViL5IlkpnbwU10lDCLfmuPSVOEaRkHUjBfeSd5FwjgGECI6Hm3J24 lSOw== X-Gm-Message-State: AN3rC/4rLcMzHXU0zOTpGdFDlZSnqwiyEEswSpSGiWsbMXzraRnV9OMdbj0HEr8oJ3ipKWWVINE4ypNh5uFO+A== X-Received: by 10.157.13.76 with SMTP id 70mr10094857oti.6.1491592052064; Fri, 07 Apr 2017 12:07:32 -0700 (PDT) Original-Received: by 10.157.80.133 with HTTP; Fri, 7 Apr 2017 12:07:31 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 2mqwIEo3yPNk1WTBNVIb2j4vyOY X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::235 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:213773 Archived-At: On Fri, Apr 7, 2017 at 2:30 PM, Drew Adams wrote: >> >> So what do you think about the byte-code type, which supports many, but >> not all, sequence operations? Is that a long-standing bug? > > I know nothing about it; sorry. If it is then it is. > > Emacs, like Common Lisp, should have a well-defined sequence > type. We aren't required to model ours on CL's, but other > things being equal it wouldn't be a bad idea to look to CL > for guidance/inspiration. AFAIK, CL's structures (if defined without a :type argument) are not sequences, and I don't see any need for Elisp's to be either. To quote the elisp manual: "The common property that all sequences have is that each is an ordered collection of elements." A record's elements are more like an unordered set. If you do (cl-defstruct person age height), you don't care whether 'age' goes before 'height', just that person-age gives you the age field. And some sequence operations make no sense on records: e.g., doing 'sort' or 'reverse' on a record would not result in a valid record. 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.