[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Scheme-reports] For WG1: Byte-vector literal syntax
Hi all,
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 :-)
I
wanted to point out the choices Erlang has made for its literal
representation of byte-vectors.
- byte-vectors are enclosed between double angle-brackets,
<<>>. In Scheme, this would naturally appear as #bs() or
similar.
- 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
length-nine byte-vector.
- 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).
So Scheme could have something like:
#bs(1 2 3)
#bs("ABC" 1 2 3 "DEF")
#bs(65
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.
Regards,
Tony
--
Tony Garnock-Jones
tonygarnockjones@x
http://homepages.kcbbs.gen.nz/tonyg/
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports