MessagePack

Supporting a "Pair" type using one of the reserved prefix bytes

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Specification
  • Labels:
    None

Description

I propose using one of the reserved bytes (such as 0xc1 for example), to support the concept of a "Pair" type. The Pair would be a special case of a 2-element array.

There are a number of cases where a "Pair" type is useful, especially when you want to try and save as many bytes as possible in the serialialised format.

I could not find a Wiki page or anything describing proposed uses for these reserved bytes, so I thought an issue here was an appropriate place to put it. Feel free to move this elsewhere if appropriate

Activity

Hide
Shane Holloway added a comment - 15/Mar/12 8:20 AM

While possibly semantically useful addition, it is no more space efficient than using `fix array` type (1001XXXX) because the length (up to 15) is encoded in the type sentinel.

Show
Shane Holloway added a comment - 15/Mar/12 8:20 AM While possibly semantically useful addition, it is no more space efficient than using `fix array` type (1001XXXX) because the length (up to 15) is encoded in the type sentinel.

People

Vote (0)
Watch (0)

Dates

  • Created:
    22/Feb/12 9:35 PM
    Updated:
    15/Mar/12 8:20 AM