chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Extending the #u8(...) notation


From: felix . winkelmann
Subject: Extending the #u8(...) notation
Date: Tue, 06 Jun 2023 16:38:09 +0200

Hi!

Kristian Lein-Mathisen suggested an extension to the bytevector syntax
for SRFI-4 and R7RS bytevectors (which becomes more relevant in the
forthcoming UTF-aware CHICKEN) which seems quite practical. I'd be
eager to know how useful other users consider this feature before I
submit a patch.

Basically, it just means to allow strings and character literals as
elements of byte vectors written as "#u8(...)". Strings would then
designate UTF-8 byte sequences, with characters being the same
(equivalent to a 1-length string), so you could write:

    #u8(0x7f "EL" #\F ...)

being the same as:

    #u8(0x7f 0x45 0x4c 0x46 ...)

This is incompatible to SRFI-4 but similar to SRFI-207.

#u8("foo") would effectively be identical to the SRFI-207 notation
#u8"foo". Seems quite orthogonal to me.

Any thoughts?


felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]