unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64960: Documentation for copy-sequence
@ 2023-07-30 16:42 uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-30 18:36 ` Eli Zaretskii
  0 siblings, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-30 16:42 UTC (permalink / raw)
  To: 64960



Have been reading the documentation for "copy-sequence".  The description,
specifically

"The elements of a list, vector or record are not copied; they are
shared with the original."

is not very clear about what it does and what one gets.

--------------------

copy-sequence is a built-in function in ‘C source code’.

(copy-sequence ARG)

Type: (function (sequence) sequence)

Return a copy of a list, vector, string, char-table or record.
The elements of a list, vector or record are not copied; they are
shared with the original.

If the original sequence is empty, this function may return
the same empty object instead of its copy.

This function does not change global state, including the match data.







^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 16:42 bug#64960: Documentation for copy-sequence uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-30 18:36 ` Eli Zaretskii
  2023-07-30 19:20   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2023-07-30 18:36 UTC (permalink / raw)
  To: uzibalqa; +Cc: 64960

> Date: Sun, 30 Jul 2023 16:42:28 +0000
> From:  uzibalqa via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Have been reading the documentation for "copy-sequence".  The description,
> specifically
> 
> "The elements of a list, vector or record are not copied; they are
> shared with the original."
> 
> is not very clear about what it does and what one gets.

As the doc string says: the elements are not copied.  You get a new
sequence whose elements are shared with the original one.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 18:36 ` Eli Zaretskii
@ 2023-07-30 19:20   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-30 19:59     ` Dmitry Gutov
  2023-07-31  2:21     ` Eli Zaretskii
  0 siblings, 2 replies; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-30 19:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64960






Sent with Proton Mail secure email.

------- Original Message -------
On Monday, July 31st, 2023 at 6:36 AM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Sun, 30 Jul 2023 16:42:28 +0000
> > From: uzibalqa via "Bug reports for GNU Emacs,
> > the Swiss army knife of text editors" bug-gnu-emacs@gnu.org
> > 
> > Have been reading the documentation for "copy-sequence". The description,
> > specifically
> > 
> > "The elements of a list, vector or record are not copied; they are
> > shared with the original."
> > 
> > is not very clear about what it does and what one gets.
> 
> 
> As the doc string says: the elements are not copied. You get a new
> sequence whose elements are shared with the original one.
> 

So it returns a copy but elements are not copied.  So what happens exactly ?
You get a reference to the original ?  When I modify the copy, the original 
remains intact.  It would help if the description in broadened, it is currently
too cryptic.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 19:20   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-30 19:59     ` Dmitry Gutov
  2023-07-30 20:09       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-31  2:21     ` Eli Zaretskii
  1 sibling, 1 reply; 24+ messages in thread
From: Dmitry Gutov @ 2023-07-30 19:59 UTC (permalink / raw)
  To: uzibalqa, Eli Zaretskii; +Cc: 64960

On 30/07/2023 22:20, uzibalqa via Bug reports for GNU Emacs, the Swiss 
army knife of text editors wrote:
> So it returns a copy but elements are not copied.  So what happens exactly ?
> You get a reference to the original ?  When I modify the copy, the original
> remains intact.

The list (if the sequence is a list) is new (from newly allocated cons 
cells), but the values inside (in cars of those conses) are shared with 
the original list.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 19:59     ` Dmitry Gutov
@ 2023-07-30 20:09       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-30 20:15         ` Dmitry Gutov
  0 siblings, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-30 20:09 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Eli Zaretskii, 64960


------- Original Message -------
On Monday, July 31st, 2023 at 7:59 AM, Dmitry Gutov <dmitry@gutov.dev> wrote:


> On 30/07/2023 22:20, uzibalqa via Bug reports for GNU Emacs, the Swiss
> army knife of text editors wrote:
> 
> > So it returns a copy but elements are not copied. So what happens exactly ?
> > You get a reference to the original ? When I modify the copy, the original
> > remains intact.
> 
> 
> The list (if the sequence is a list) is new (from newly allocated cons
> cells), but the values inside (in cars of those conses) are shared with
> the original list.

It is not evident what the meaning of "shared" means ?  If I use a string,
I get an exact copy and when I change a single character the newlist is 
changed,  the original string remains the same.  So what is shared exactly ?






^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 20:09       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-30 20:15         ` Dmitry Gutov
  2023-07-30 20:41           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-31  1:13           ` Drew Adams
  0 siblings, 2 replies; 24+ messages in thread
From: Dmitry Gutov @ 2023-07-30 20:15 UTC (permalink / raw)
  To: uzibalqa; +Cc: Eli Zaretskii, 64960

On 30/07/2023 23:09, uzibalqa wrote:
> It is not evident what the meaning of "shared" means ?  If I use a string,
> I get an exact copy and when I change a single character the newlist is
> changed,  the original string remains the same.  So what is shared exactly ?

A string doesn't share anything because characters are not reference 
values. They are simply copied.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 20:15         ` Dmitry Gutov
@ 2023-07-30 20:41           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-31  1:13           ` Drew Adams
  1 sibling, 0 replies; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-30 20:41 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Eli Zaretskii, 64960

------- Original Message -------
On Monday, July 31st, 2023 at 8:15 AM, Dmitry Gutov <dmitry@gutov.dev> wrote:


> On 30/07/2023 23:09, uzibalqa wrote:
> 
> > It is not evident what the meaning of "shared" means ? If I use a string,
> > I get an exact copy and when I change a single character the newlist is
> > changed, the original string remains the same. So what is shared exactly ?
> 
> 
> A string doesn't share anything because characters are not reference
> values. They are simply copied.

So why does the description also refer to a string.  With strings, things
do not work like the description.

(copy-sequence ARG)






^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 20:15         ` Dmitry Gutov
  2023-07-30 20:41           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-31  1:13           ` Drew Adams
  2023-07-31  1:22             ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 24+ messages in thread
From: Drew Adams @ 2023-07-31  1:13 UTC (permalink / raw)
  To: Dmitry Gutov, uzibalqa; +Cc: Eli Zaretskii, 64960@debbugs.gnu.org

> > It is not evident what the meaning of "shared" means ?  If I use a
> > string, I get an exact copy and when I change a single character
> > the newlist is changed,  the original string remains the same.
> > So what is shared exactly ?
> 
> A string doesn't share anything because characters are not reference
> values. They are simply copied.

Yes and no.
Chars are not shared, but char properties are.

(setq foo (propertize "abcd" 'p1 t 'p2 42))
;; -> #("abcd" 0 4 (p2 42 p1 t))
(setq bar (copy-sequence foo))
;; -> #("abcd" 0 4 (p1 t p2 42))
(aset foo 1 ?W) ; -> ?W, aka 87
foo ; -> #("aWcd" 0 4 (p2 42 p1 t))
bar ; -> #("abcd" 0 4 (p1 t p2 42))

^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  1:13           ` Drew Adams
@ 2023-07-31  1:22             ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-31  1:36               ` Drew Adams
  0 siblings, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-31  1:22 UTC (permalink / raw)
  To: Drew Adams; +Cc: Dmitry Gutov, Eli Zaretskii, 64960@debbugs.gnu.org


------- Original Message -------
On Monday, July 31st, 2023 at 1:13 PM, Drew Adams <drew.adams@oracle.com> wrote:


> > > It is not evident what the meaning of "shared" means ? If I use a
> > > string, I get an exact copy and when I change a single character
> > > the newlist is changed, the original string remains the same.
> > > So what is shared exactly ?
> > 
> > A string doesn't share anything because characters are not reference
> > values. They are simply copied.
> 
> 
> Yes and no.
> Chars are not shared, but char properties are.
> 
> (setq foo (propertize "abcd" 'p1 t 'p2 42))
> ;; -> #("abcd" 0 4 (p2 42 p1 t))
> 
> (setq bar (copy-sequence foo))
> ;; -> #("abcd" 0 4 (p1 t p2 42))
> 
> (aset foo 1 ?W) ; -> ?W, aka 87
> 
> foo ; -> #("aWcd" 0 4 (p2 42 p1 t))
> 
> bar ; -> #("abcd" 0 4 (p1 t p2 42))

Ok, meaning that the actual string becomes different, yet changing
the a property, changes the property on both foo and bar ?






^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  1:22             ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-31  1:36               ` Drew Adams
  2023-07-31  1:50                 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 24+ messages in thread
From: Drew Adams @ 2023-07-31  1:36 UTC (permalink / raw)
  To: uzibalqa; +Cc: Dmitry Gutov, Eli Zaretskii, 64960@debbugs.gnu.org

> > > A string doesn't share anything because characters are not reference
> > > values. They are simply copied.
> >
> >
> > Yes and no.
> > Chars are not shared, but char properties are.
> >
> > (setq foo (propertize "abcd" 'p1 t 'p2 42))
> > ;; -> #("abcd" 0 4 (p2 42 p1 t))
> > (setq bar (copy-sequence foo))
> > ;; -> #("abcd" 0 4 (p1 t p2 42))
> > (aset foo 1 ?W) ; -> ?W, aka 87
> > foo ; -> #("aWcd" 0 4 (p2 42 p1 t))
> > bar ; -> #("abcd" 0 4 (p1 t p2 42))
> 
> Ok, meaning that the actual string becomes different, yet changing
> the a property, changes the property on both foo and bar ?

No.  I didn't change a property.  I swapped one
char for another.  The doc says that the arg's
"elements" are shared.  A string's "elements"
are its chars.  But as Yuri pointed out, the
chars themselves aren't shared, because they
aren't sharable: they aren't references.

Strings can also have properties.  We sometimes
say that it's the characters that have the
properties, but really it's that the properties
are attached to the characters in the string or
buffer - the properties are associated with
string or buffer positions.  The chars themselves
don't really have properties.  The properties are
shared when you copy a string; the chars are not.

This is really more of a natural-language nuance,
about what it means for string elements to be
shared.  You can ignore it, if what I'm saying
just confuses things.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  1:36               ` Drew Adams
@ 2023-07-31  1:50                 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-31  1:50 UTC (permalink / raw)
  To: Drew Adams; +Cc: Dmitry Gutov, Eli Zaretskii, 64960@debbugs.gnu.org

------- Original Message -------
On Monday, July 31st, 2023 at 1:36 PM, Drew Adams <drew.adams@oracle.com> wrote:


> > > > A string doesn't share anything because characters are not reference
> > > > values. They are simply copied.
> > > 
> > > Yes and no.
> > > Chars are not shared, but char properties are.
> > > 
> > > (setq foo (propertize "abcd" 'p1 t 'p2 42))
> > > ;; -> #("abcd" 0 4 (p2 42 p1 t))
> > > (setq bar (copy-sequence foo))
> > > ;; -> #("abcd" 0 4 (p1 t p2 42))
> > > (aset foo 1 ?W) ; -> ?W, aka 87
> > > foo ; -> #("aWcd" 0 4 (p2 42 p1 t))
> > > bar ; -> #("abcd" 0 4 (p1 t p2 42))
> > 
> > Ok, meaning that the actual string becomes different, yet changing
> > the a property, changes the property on both foo and bar ?
> 
> 
> No. I didn't change a property. I swapped one
> char for another. The doc says that the arg's
> "elements" are shared. A string's "elements"
> are its chars. But as Yuri pointed out, the
> chars themselves aren't shared, because they
> aren't sharable: they aren't references.

You only changed a character, which is not actually sharable.
But if I go change a property value for foo, I should see the
change also in bar, or not ?
 
> Strings can also have properties. We sometimes
> say that it's the characters that have the
> properties, but really it's that the properties
> are attached to the characters in the string or
> buffer - the properties are associated with
> string or buffer positions. The chars themselves
> don't really have properties. The properties are
> shared when you copy a string; the chars are not.

Meaning that I can make a copy of a string just to have 
the same properties (e.g, colour).
 
> This is really more of a natural-language nuance,
> about what it means for string elements to be
> shared. You can ignore it, if what I'm saying
> just confuses things.

Not too confusing, but required some attention.

Currently I am only interested in the actual characters
in my implementation where properties are not important.

Yet in my permute implementation I have seen that whether
I just use string or (copy-sequence string) does make a huge
difference.  Quite difficult to understand what's going on.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-30 19:20   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-30 19:59     ` Dmitry Gutov
@ 2023-07-31  2:21     ` Eli Zaretskii
  2023-07-31  2:31       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2023-07-31  2:21 UTC (permalink / raw)
  To: uzibalqa; +Cc: 64960

> Date: Sun, 30 Jul 2023 19:20:45 +0000
> From: uzibalqa <uzibalqa@proton.me>
> Cc: 64960@debbugs.gnu.org
> 
> > As the doc string says: the elements are not copied. You get a new
> > sequence whose elements are shared with the original one.
> 
> So it returns a copy but elements are not copied.  So what happens exactly ?
> You get a reference to the original ?

Yes.

> When I modify the copy, the original remains intact.

No, if you modify an element of the copy, the corresponding element of
the original is also changed.  That's what "shared" means.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  2:21     ` Eli Zaretskii
@ 2023-07-31  2:31       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-31  5:24         ` Michael Heerdegen
  0 siblings, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-31  2:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64960

------- Original Message -------
On Monday, July 31st, 2023 at 2:21 PM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Sun, 30 Jul 2023 19:20:45 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: 64960@debbugs.gnu.org
> > 
> > > As the doc string says: the elements are not copied. You get a new
> > > sequence whose elements are shared with the original one.
> > 
> > So it returns a copy but elements are not copied. So what happens exactly ?
> > You get a reference to the original ?
> 
> 
> Yes.
> 
> > When I modify the copy, the original remains intact.
> 
> 
> No, if you modify an element of the copy, the corresponding element of
> the original is also changed. That's what "shared" means.

Except for strings





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  2:31       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-31  5:24         ` Michael Heerdegen
  2023-07-31  6:19           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-31 14:34           ` Drew Adams
  0 siblings, 2 replies; 24+ messages in thread
From: Michael Heerdegen @ 2023-07-31  5:24 UTC (permalink / raw)
  To: 64960; +Cc: eliz, uzibalqa

uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

> > > When I modify the copy, the original remains intact.
> >
> >
> > No, if you modify an element of the copy, the corresponding element of
> > the original is also changed. That's what "shared" means.
>
> Except for strings

It is irrelevant what happens when you modify elements of a copied
string because it is impossible.  The statement is simply not applicable
to strings.  That's why the docstring only speaks of "list, vector or
record".

Note that substituting a character in a string is not the same as
modifying the character.  You are substituting a sequence element with
another one and not modifying an element in that case.

The same is true for the list (1 2 3) for example.  Exactly the same
situation as for a string: You can replace the number 2 in a copy with
another one but you can't modify the number 2 in the list.  Numbers and
characters are not mutable.

Michael.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  5:24         ` Michael Heerdegen
@ 2023-07-31  6:19           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-01  3:56             ` Michael Heerdegen
  2023-07-31 14:34           ` Drew Adams
  1 sibling, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-31  6:19 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 64960, eliz


------- Original Message -------
On Monday, July 31st, 2023 at 5:24 PM, Michael Heerdegen <michael_heerdegen@web.de> wrote:


> uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" bug-gnu-emacs@gnu.org writes:
> 
> > > > When I modify the copy, the original remains intact.
> > > 
> > > No, if you modify an element of the copy, the corresponding element of
> > > the original is also changed. That's what "shared" means.
> > 
> > Except for strings
> 
> 
> It is irrelevant what happens when you modify elements of a copied
> string because it is impossible. The statement is simply not applicable
> to strings. That's why the docstring only speaks of "list, vector or
> record".

> Note that substituting a character in a string is not the same as
> modifying the character. You are substituting a sequence element with
> another one and not modifying an element in that case.

That I understand.  I am substituting, but still one gets a different string
nevertheless.
 
> The same is true for the list (1 2 3) for example. Exactly the same
> situation as for a string: You can replace the number 2 in a copy with
> another one but you can't modify the number 2 in the list. Numbers and
> characters are not mutable.

This is the difficult part.  You have a copy of a list and you can swap
elements but not make new ones.  So what you share is the address, where
element 2 say uses the address of element 3.

All this copy-sequence is then quite restrictive in its capabilities.
It does not allow much changes.   
 
> Michael.
>





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  5:24         ` Michael Heerdegen
  2023-07-31  6:19           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-31 14:34           ` Drew Adams
  1 sibling, 0 replies; 24+ messages in thread
From: Drew Adams @ 2023-07-31 14:34 UTC (permalink / raw)
  To: Michael Heerdegen, 64960@debbugs.gnu.org; +Cc: eliz@gnu.org, uzibalqa@proton.me

> > > > When I modify the copy, the original remains intact.
> > >
> > > No, if you modify an element of the copy, the corresponding element of
> > > the original is also changed. That's what "shared" means.
> >
> > Except for strings
> 
> It is irrelevant what happens when you modify elements of a copied
> string because it is impossible.  The statement is simply not applicable
> to strings.  That's why the docstring only speaks of "list, vector or
> record".
> 
> Note that substituting a character in a string is not the same as
> modifying the character.  You are substituting a sequence element with
> another one and not modifying an element in that case.
> 
> The same is true for the list (1 2 3) for example.  Exactly the same
> situation as for a string: You can replace the number 2 in a copy with
> another one but you can't modify the number 2 in the list.  Numbers and
> characters are not mutable.

Well put.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-07-31  6:19           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-01  3:56             ` Michael Heerdegen
  2023-08-13  4:27               ` Michael Heerdegen
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Heerdegen @ 2023-08-01  3:56 UTC (permalink / raw)
  To: uzibalqa; +Cc: 64960, eliz

uzibalqa <uzibalqa@proton.me> writes:

> > The same is true for the list (1 2 3) for example. Exactly the same
> > situation as for a string: You can replace the number 2 in a copy with
> > another one but you can't modify the number 2 in the list. Numbers and
> > characters are not mutable.
>
> This is the difficult part.  You have a copy of a list and you can swap
> elements but not make new ones.  So what you share is the address, where
> element 2 say uses the address of element 3.
>
> All this copy-sequence is then quite restrictive in its capabilities.
> It does not allow much changes.

I must admit that I don't understand this answer.  What does "can't make
new elements" mean?  "Does not allow changes"...you lost me here.

Michael.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-08-01  3:56             ` Michael Heerdegen
@ 2023-08-13  4:27               ` Michael Heerdegen
  2023-08-14 10:14                 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Heerdegen @ 2023-08-13  4:27 UTC (permalink / raw)
  To: uzibalqa; +Cc: 64960, eliz

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I must admit that I don't understand this answer.  What does "can't make
> new elements" mean?  "Does not allow changes"...you lost me here.

We seem to have finished this discussion, and I think all questions have
been answered.  Is there anything, from your side, that you expect we
should do?


TIA,

Michael.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-08-13  4:27               ` Michael Heerdegen
@ 2023-08-14 10:14                 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-14 23:46                   ` Michael Heerdegen
  0 siblings, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-14 10:14 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 64960, eliz


------- Original Message -------
On Sunday, August 13th, 2023 at 4:27 PM, Michael Heerdegen <michael_heerdegen@web.de> wrote:


> Michael Heerdegen michael_heerdegen@web.de writes:
> 
> > I must admit that I don't understand this answer. What does "can't make
> > new elements" mean? "Does not allow changes"...you lost me here.
> 
> 
> We seem to have finished this discussion, and I think all questions have
> been answered. Is there anything, from your side, that you expect we
> should do?

Although I understand what it does, I om not sure if it would benefit
about some of the details we discussed.
 
> TIA,
> 
> Michael.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-08-14 10:14                 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-14 23:46                   ` Michael Heerdegen
  2023-08-15  0:43                     ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Heerdegen @ 2023-08-14 23:46 UTC (permalink / raw)
  To: uzibalqa; +Cc: 64960, eliz

uzibalqa <uzibalqa@proton.me> writes:

> Although I understand what it does, I om not sure if it would benefit
> about some of the details we discussed.

What in particular?  A lot of the stuff discussed is a direct
consequence of the copy being a new sequence object whose elements have
not been copied.  The manual tries to describe some implications.

Or should we try to find a better wording (to make more clear that
"modify" doesn't mean "replace") - for what part(s)?  What concretely
would have helped you to understand that part of the manual better?

What parts of the documentation have you read so far?


Thx,

Michael.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-08-14 23:46                   ` Michael Heerdegen
@ 2023-08-15  0:43                     ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-15 23:28                       ` Michael Heerdegen
  0 siblings, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-15  0:43 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 64960, eliz






Sent with Proton Mail secure email.

------- Original Message -------
On Tuesday, August 15th, 2023 at 11:46 AM, Michael Heerdegen <michael_heerdegen@web.de> wrote:


> uzibalqa uzibalqa@proton.me writes:
> 
> > Although I understand what it does, I om not sure if it would benefit
> > about some of the details we discussed.
> 
> 
> What in particular? A lot of the stuff discussed is a direct
> consequence of the copy being a new sequence object whose elements have
> not been copied. The manual tries to describe some implications.
> 
> Or should we try to find a better wording (to make more clear that
> "modify" doesn't mean "replace") - for what part(s)? What concretely
> would have helped you to understand that part of the manual better?

I found the following is mostly targeted at experienced users.

"The elements of a list, vector or record are not copied; they are
shared with the original."
 
Adding additional wording that it means that not everything is actually copied. 
Some aspects are actually reference values.  Meaning that if you change the
copied sequence, you could inadvertently change the original sequence.

> What parts of the documentation have you read so far?
> 
> 
> Thx,
> 
> Michael.
>





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-08-15  0:43                     ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-15 23:28                       ` Michael Heerdegen
  2023-08-16  4:35                         ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Heerdegen @ 2023-08-15 23:28 UTC (permalink / raw)
  To: 64960; +Cc: uzibalqa, eliz

uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

> "The elements of a list, vector or record are not copied; they are
> shared with the original."
>
> Adding additional wording that it means that not everything is
> actually copied.
> Some aspects are actually reference values.  Meaning that if you change the
> copied sequence, you could inadvertently change the original sequence.

That's the normal behavior in a Lisp, so this belongs into the manual.
After reading (info "(elisp) Sequence Functions") (where this function
is introduced) I think, as far as I understand, that that page tries to
explain this aspect you mention thoroughly.

Michael.





^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-08-15 23:28                       ` Michael Heerdegen
@ 2023-08-16  4:35                         ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-11 15:55                           ` Stefan Kangas
  0 siblings, 1 reply; 24+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-16  4:35 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 64960, eliz






Sent with Proton Mail secure email.

------- Original Message -------
On Wednesday, August 16th, 2023 at 11:28 AM, Michael Heerdegen <michael_heerdegen@web.de> wrote:


> uzibalqa via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" bug-gnu-emacs@gnu.org writes:
> 
> > "The elements of a list, vector or record are not copied; they are
> > shared with the original."
> > 
> > Adding additional wording that it means that not everything is
> > actually copied.
> > Some aspects are actually reference values. Meaning that if you change the
> > copied sequence, you could inadvertently change the original sequence.
> 
> 
> That's the normal behavior in a Lisp, so this belongs into the manual.
> After reading (info "(elisp) Sequence Functions") (where this function
> is introduced) I think, as far as I understand, that that page tries to
> explain this aspect you mention thoroughly. - Michael.

Is it not customary to include any cross references to the relevant parts
of the manual.  The help using 'C-h f' would benefit if there could be
some links that get you to the relevant part of the manual directly.






^ permalink raw reply	[flat|nested] 24+ messages in thread

* bug#64960: Documentation for copy-sequence
  2023-08-16  4:35                         ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-11 15:55                           ` Stefan Kangas
  0 siblings, 0 replies; 24+ messages in thread
From: Stefan Kangas @ 2023-09-11 15:55 UTC (permalink / raw)
  To: uzibalqa; +Cc: Michael Heerdegen, 64960-done, eliz

Version: 29.2

uzibalqa <uzibalqa@proton.me> writes:

> Is it not customary to include any cross references to the relevant parts
> of the manual.  The help using 'C-h f' would benefit if there could be
> some links that get you to the relevant part of the manual directly.

Such a cross-reference was added in commit a8c8a4e3680d, so I'm closing
this bug.





^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2023-09-11 15:55 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-30 16:42 bug#64960: Documentation for copy-sequence uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-30 18:36 ` Eli Zaretskii
2023-07-30 19:20   ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-30 19:59     ` Dmitry Gutov
2023-07-30 20:09       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-30 20:15         ` Dmitry Gutov
2023-07-30 20:41           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-31  1:13           ` Drew Adams
2023-07-31  1:22             ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-31  1:36               ` Drew Adams
2023-07-31  1:50                 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-31  2:21     ` Eli Zaretskii
2023-07-31  2:31       ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-31  5:24         ` Michael Heerdegen
2023-07-31  6:19           ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-01  3:56             ` Michael Heerdegen
2023-08-13  4:27               ` Michael Heerdegen
2023-08-14 10:14                 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-14 23:46                   ` Michael Heerdegen
2023-08-15  0:43                     ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-15 23:28                       ` Michael Heerdegen
2023-08-16  4:35                         ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-11 15:55                           ` Stefan Kangas
2023-07-31 14:34           ` Drew Adams

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).