ServerJS/Binary/C: Difference between revisions

no edit summary
No edit summary
Line 1: Line 1:
:''See also: the [[/Show of hands]].''
:''See also: the [[/Show of hands/]] and [[/Essay/]] portion.''
This proposal was written by Daniel Friesen as an alternative to the [[ServerJS/Binary/B|Binary/B]] proposal.
This proposal was written by Daniel Friesen as an alternative to the [[ServerJS/Binary/B|Binary/B]] proposal.


Line 47: Line 47:
:
:
:There is another name which does fit this kind of operation, "Append" (Side note, Wrench.js does add .append to Array). Using [1,2,3].append([4,5,6]); DOES push 4, 5, and 6 onto the array creating the array [1,2,3,4,5,6].
:There is another name which does fit this kind of operation, "Append" (Side note, Wrench.js does add .append to Array). Using [1,2,3].append([4,5,6]); DOES push 4, 5, and 6 onto the array creating the array [1,2,3,4,5,6].
== ByteArray? ==
From the discussions in the ServerJS mailing list I do not recall anyone saying
"[I] want to mutate a [sequence] with the Array api". I only recall the statements
"[I] want a way to mutate a [sequence]" and "mutable, like an Array".
The decision to use the name "ByteArray" had nothing to do with wanting an Array
type sequence. It had to do with wanting to mutate a sequence, and Arrays being
the other type of list.
Looking into prior art the Array api does not fit. There is a more relevant term used in computing, the buffer.


== Prior art ==
== Prior art ==
Line 225: Line 215:
;buf.lastIndexOf(sequence, offset=0);
;buf.lastIndexOf(sequence, offset=0);
:Returns the index within the calling buffer object of the first or last (depending on which method is used) occurrence of the specified value, or -1 if not found.
:Returns the index within the calling buffer object of the first or last (depending on which method is used) occurrence of the specified value, or -1 if not found.
;<s>buf.reverse();</s>
:<s>Causes the sequence to be replaced by the reverse of the sequence.</s>


;buf.valueOf();
;buf.valueOf();
40

edits