chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] CHICKEN in production


From: John Cowan
Subject: Re: [Chicken-hackers] CHICKEN in production
Date: Mon, 13 Oct 2014 21:24:12 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

Aleksej Saushev scripsit:

> > Valid but useless.  It has no significance whatever.
> 
> It has no significance for what exactly?

For the Unicode Standard.  Characters like #\; and #\A and #\newline
have definite meaning to Unicode, but NUL does not.  It corresponds to
unpunched paper tape, which was traditionally ignored.

> My experience with Forth implementations that append NUL terminator
> is that this doesn't bring enough gain while adding more obstacles
> for string processing. You end up using conventional Forth strings
> (represented by pointer-length pairs) and NUL-terminated strings
> (e.g. for FFI purpose) as different concepts coexisting side by side.

Nobody is proposing the abandonment of counted strings as they currently
exist, or the creation of two kinds of strings.  The original idea was
simply to ensure that the internal representation of a string always
contains a zero byte *outside* the count and *not* visible to Scheme,
so that it can safely be shared with C without copying.

It is already the case that we don't allow a string that contains a zero
byte to be passed to C by copying.  So de facto there are already two
kinds of strings, those that can be passed to C and those that can't.
I proposed eliminating that distinction by disallowing strings with zero
bytes at all.

> Allowing NUL within strings allows better handling of some protocols that
> are text-oriented yet use NUL as field separator.

That's a good point, and may be enough to warrant allowing NUL in
strings, though most of the time C manages fine without being able to
handle such things in its (effectively) native string type.  A procedure
read-null-terminated-string would probably be sufficient; note
that I am not proposing the elimination of the character #\u0000.

-- 
John Cowan          http://www.ccil.org/~cowan        address@hidden
"Repeat this until 'update-mounts -v' shows no updates.
You may well have to log in to particular machines, hunt down
people who still have processes running, and kill them."



reply via email to

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