Ticket #211 (new defect)

Opened 3 years ago

Last modified 3 years ago

(Resolved) Builtins: Remove ByteArray, introduce byte and use Vector.<byte> instead

Reported by: lth Assigned to: lth
Type: defect Priority: trivial
Component: Spec Version: 4
Keywords: Cc:

Description

Lars and Jeff propose that we abandon ByteArray, since Vector.<int> can be wrapped to provide the same API and the same storage efficiency.

We also propose that we introduce a new numeric type byte (8-bit unsigned integer) that fits in with the rest of the language like int and uint do.

Attachments

Change History

Changed 3 years ago by graydon

Sounds good to me. I thought we went toward this earlier and then backed off, but I don't recall why.

Changed 3 years ago by lth

IIRC we were trying not to introduce too much new machinery at the time :-P Since ByteArray is just a container for bytes with no methods except get and set, it was an acceptable compromise.

I should note that the introduction of byte is optional, as Vector.<int> is enough to implement an efficient ByteArray class, for example.

Changed 3 years ago by lth

  • component changed from Proposals to Spec

we agreed to adopt byte and kill ByteArray?.

Changed 3 years ago by lth

  • priority changed from major to trivial
  • summary changed from Builtins: Remove ByteArray, introduce byte and use Vector.<byte> instead to (Resolved) Builtins: Remove ByteArray, introduce byte and use Vector.<byte> instead

See also #234, we're now trying to kill byte and introduce ByteVector as a subtype of Vector.<uint>.

Note: See TracTickets for help on using tickets.