From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: Shouldn't records be sequences? Date: Sun, 12 Apr 2020 19:02:26 +0200 Message-ID: <87mu7gbpst.fsf@gmail.com> References: <871rotdp21.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="2942"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 12 19:02:35 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNg0B-0000gy-8p for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Apr 2020 19:02:35 +0200 Original-Received: from localhost ([::1]:35256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNg09-0002W3-8z for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Apr 2020 13:02:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46970) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNfzX-00026G-TE for emacs-devel@gnu.org; Sun, 12 Apr 2020 13:01:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNfzV-0005ss-TF for emacs-devel@gnu.org; Sun, 12 Apr 2020 13:01:55 -0400 Original-Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:39089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNfzV-0005s4-MV for emacs-devel@gnu.org; Sun, 12 Apr 2020 13:01:53 -0400 Original-Received: by mail-lf1-x131.google.com with SMTP id m2so4891086lfo.6 for ; Sun, 12 Apr 2020 10:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=RHEKvBZ4n9BzLYDmXXhzicVxgcJ+vFMuQotD/0+k7x8=; b=GU1L7TrZyRMC5jzgCz8I709N62s/3Axy7Qzy4WHO1d9Dc1cGjGZC0ZDEGdl0Jhx7P5 zzAdBUgvZFhZx/E/yfq1PPPyA2WgOwTi7QoJUcnS7tm6eB+yQKvsmxpTebfar+jVokAZ FQUWcCDxeiaYNbmwwxnLg64bizwUYCXFSm58eECGU5aZr3x6fU5dNg7WsAFIzJe5op1v QEtRakjhuZwZdR9K0F3pe48WPzjRRs5c2TBw25KvK6fYicjLcN+t5g4huarTgIu9IOt8 jHmPJanN13B5kfxzEs5Bq5A6TfoPVuZyfQ7EFwjJrdlUFCCIeylzrDwvpAR+nz76Lvos rsGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=RHEKvBZ4n9BzLYDmXXhzicVxgcJ+vFMuQotD/0+k7x8=; b=CkhN1G0VLFwYXfhJmvlou4HsZdYRh83gyMsHm38mfhu6AmqiYK0d5trB1lA31/k2KO EpCrtHhoauF8ZSvvLtZIIne6JajEmc21ejReuNDRjIl/nEcMU41RQsC28c2/T//TuPCM WPQt+vHPdllUzdVBx/0E3UHP5EjTNLfIMLAbCcEnV+Owfs56oEZ5jnDA7kap662IhM1s gvVfcgcPM3dl4qIzBEXx+EJ03FjLDhlyTxRI1FkSO430na795AhccuAAT6Y5mmxB6zjQ n8e6KP80F43SnvOX8QmEUsbhQpn2QWFMbTcKhVWEhxXlYSri8Q8HhaFp0Y47uqsV2Z7V mzKQ== X-Gm-Message-State: AGi0Pubjkir5nUzoTAj1hMxVXSVt77nb25MtzcPLDIFWdsWBTRmORgW/ 7L4XEYkwLYDmSb4krbbaHBqRsBTg/t8= X-Google-Smtp-Source: APiQypI9TNGdApzeMHApzKmmMIp/MnquvnYTPdn2tkF/phOwMOIYzGR3Qn9yA3yRkfHwFaVDmjrQqA== X-Received: by 2002:ac2:4a9d:: with SMTP id l29mr7787418lfp.4.1586710912184; Sun, 12 Apr 2020 10:01:52 -0700 (PDT) Original-Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id g8sm6880097ljl.45.2020.04.12.10.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 10:01:51 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::131 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246871 Archived-At: On Sun, 12 Apr 2020 12:30:26 -0400 Stefan Monnier wrote: >> Records currently seem a bit weird: `aref', `cl-loop''s "across" clause >> (which uses `aref'), `copy-sequence' support them; `substring' (which >> does support vectors) and other sequence functions do not. > > My opinion is that records are not sequences, just like C's `structs` > and Java's objects are not sequences (e.g. it doesn't make much sense to > concatenate records or to take subsequences of them). Some of our > builtin functions operating on sequences also work on records, but > that's only motivated by the need for backward compatibility with code > which used to expect `cl-defstruct` to use vectors instead of records. I think that makes sense, quite possibly more sense than the other way ("records are sequences"), but shouldn't the current state, where some sequence functions work with records and some do not, and (info "(elisp) Records") explicitly mentions `aref' and `copy-sequence', be improved in some way? IOW, if records really are "much like a vector" (to quote the manual section), is there any reason not to make the other sequence functions support them? Alternatively, if their being like a vector is only an implementation detail, does it make sense to expose that in Lisp at all and document it? Thanks, =C5=A0t=C4=9Bp=C3=A1n