Re: [Sbcl-commits] master: Add remark about a COPY-LIST added in b1b08c0929
John Lorentzson via Sbcl-devel <[email protected]>
| Newsgroups | gmane.lisp.steel-bank.devel |
|---|---|
| Organization | Datorföreningen Stacken |
| Message-ID | <[email protected]> |
Stas Boukarev wrote: > Is that really not evident? The standard says specifically that the > result might be shared or identical. You're right, the specification does say that, but with some slightly confusing wording in one part. CL specification regarding the REMOVE functions: > If any elements need to be removed, the result will be a copy. The > result of remove may share with sequence [...] So the result "will be a copy", but it "may share with sequence"... One should of course assume the result will indeed share with the sequence, but I wouldn't say it's completely obvious that one should assume that. I got bit by this recently in fact and spent quite some time staring at this sentence before accepting reality. The result of removing nothing from a sequence being able to be identical to the original sequence is however quite obvious from the text. (Neither case is really intuitive in my opinion, but the specification is as it is.) I have no real opinion on the commit in question, just felt like mentioning that while you are right, the spec isn't super clear on the details of this point. -duuq-