unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>,
	Drew Adams <drew.adams@oracle.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: If records are not sequences, why does aref work on records?
Date: Sat, 08 Apr 2017 11:34:18 +0000	[thread overview]
Message-ID: <CAArVCkQPL9O1QRVvnsHJn0o3-wVpPg4s+=poLDazj99sqUw44A@mail.gmail.com> (raw)
In-Reply-To: <CAM-tV--ybsu+WtMTk8CQFz_FUgBt1cQgQizsrGdax4D2JpTTJw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]

Noam Postavsky <npostavs@users.sourceforge.net> schrieb am Fr., 7. Apr.
2017 um 23:03 Uhr:

> On Fri, Apr 7, 2017 at 4:49 PM, Drew Adams <drew.adams@oracle.com> wrote:
> >
> > 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?
>
> Up until the recent changes, the things produced by cl-defstruct
> make-foo functions were vectors with the first element being the
> symbol 'cl-struct-foo'. So they could be indexed with aref and copied
> with copy-sequence. Now they are "record" objects, but we don't want
> to break code that uses aref and copy-sequence on them.
>
>
While the manual mentions that vectors or lists are used, it doesn't say
that the sequence functions can simply be used. Rather, the implementation
as sequence is an implementation detail that users shouldn't rely on.
cl-defstruct even creates a copy-FOO function to copy structures, which
should be used instead of copy-sequence. Therefore, I think it's fine to
not allow copy-sequence and aref on structure types any more, if this
change is properly documented.

[-- Attachment #2: Type: text/html, Size: 1899 bytes --]

  parent reply	other threads:[~2017-04-08 11:34 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 15:31 Recent change in master breaks async package update using paradox Kaushal Modi
2017-04-05 16:05 ` Eli Zaretskii
2017-04-05 21:59 ` Tom Tromey
2017-04-05 22:48   ` Kaushal Modi
2017-04-06  5:00     ` Lars Brinkhoff
2017-04-06 10:46       ` Kaushal Modi
2017-04-06 11:00         ` Lars Brinkhoff
2017-04-06 11:28           ` Kaushal Modi
2017-04-06 12:12             ` Lars Brinkhoff
2017-04-06 12:22               ` Noam Postavsky
2017-04-06 12:36                 ` Lars Brinkhoff
2017-04-06 11:19 ` Lars Brinkhoff
2017-04-07  5:42 ` Lars Brinkhoff
2017-04-07  7:25   ` Eli Zaretskii
2017-04-07  7:40     ` Lars Brinkhoff
2017-04-07  9:51       ` Eli Zaretskii
2017-04-07 13:28         ` Debugging problems using async.el Lars Brinkhoff
2017-04-07 14:11           ` Kaushal Modi
2017-04-07 14:39             ` Eli Zaretskii
2017-04-07 18:10             ` Lars Brinkhoff
2017-04-07 11:59       ` Recent change in master breaks async package update using paradox Stefan Monnier
2017-04-07 13:07         ` What is a "sequence"? Lars Brinkhoff
2017-04-07 13:26           ` Stefan Monnier
2017-04-07 16:56       ` If records are not sequences, why does aref work on records? Paul Eggert
2017-04-07 17:27         ` Lars Brinkhoff
2017-04-07 17:41           ` Drew Adams
2017-04-07 18:23             ` Lars Brinkhoff
2017-04-07 18:30               ` Drew Adams
2017-04-07 19:07                 ` Noam Postavsky
2017-04-07 19:13                   ` Stefan Monnier
2017-04-07 20:49                     ` Drew Adams
2017-04-07 21:00                       ` Clément Pit-Claudel
2017-04-07 21:02                       ` Noam Postavsky
2017-04-08  1:58                         ` Paul Eggert
2017-04-08  5:03                           ` Lars Brinkhoff
2017-04-08  5:25                             ` Lars Brinkhoff
2017-04-08  5:34                           ` Noam Postavsky
2017-04-08  7:42                             ` Paul Eggert
2017-04-08  7:50                               ` Eli Zaretskii
2017-04-08 13:33                               ` Noam Postavsky
2017-04-08 11:34                         ` Philipp Stephani [this message]
2017-04-08 12:24                           ` Clément Pit-Claudel
2017-04-08 15:24                             ` Lars Brinkhoff
2017-04-08 17:17                               ` Clément Pit-Claudel
2017-04-08 17:46                                 ` Lars Brinkhoff
2017-04-09 19:15                             ` Richard Stallman
2017-04-11 12:27                               ` Stefan Monnier
2017-04-07 19:25                   ` Clément Pit-Claudel
2017-04-07 19:41                     ` Noam Postavsky
2017-04-07 20:12                       ` Clément Pit-Claudel
2017-04-07 19:43                     ` Stefan Monnier
2017-04-07 17:59         ` Clément Pit-Claudel
2017-04-07 18:28 ` Recent change in master breaks async package update using paradox Lars Brinkhoff
2017-04-08  6:50   ` Lars Brinkhoff
2017-04-08 12:25     ` Clément Pit-Claudel
2017-04-08 13:35     ` Kaushal Modi
2017-04-08 18:21       ` Lars Brinkhoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAArVCkQPL9O1QRVvnsHJn0o3-wVpPg4s+=poLDazj99sqUw44A@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).