[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Scheme-reports] For WG1: Byte-vector literal syntax
I've been following the recent WG1 discussion of byte-vector literal syntax with interest, but I'm not a working-group member, so I'll have to post here instead and hope the right people see the posting :-)
wanted to point out the choices Erlang has made for its literal
representation of byte-vectors.
So Scheme could have something like:
- byte-vectors are enclosed between double angle-brackets,
<<>>. In Scheme, this would naturally appear as #bs() or
- the contents are given as either literal numeric
values, comma-separated, or as double-quoted strings of ASCII; for
example, <<1, 2, 3>> is a length-three byte-vector, as is
<<"ABC">>. <<"ABC", 1, 2, 3, "DEF">> is a
- Erlang also supports a more sophisticated syntax for
pattern-matching and unquoting other encoded values of various types and
encodings, which I don't think would directly fit Scheme well at this
point (and almost certainly not for WG1 at all).
#bs(1 2 3)
#bs("ABC" 1 2 3 "DEF")
66 67 1 2 3 68 69 70)
#bs(#x41 #x42 #x43)
... with the restriction that only
ASCII characters be used in the shorthand double-quoted subsyntax.
Scheme-reports mailing list