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: Michele La Monaca
Subject: Re: [Chicken-hackers] CHICKEN in production
Date: Mon, 13 Oct 2014 14:35:54 +0200

On Wed, Oct 8, 2014 at 5:54 PM, John Cowan <address@hidden> wrote:
> Peter Bex scripsit:
>
>> It was discussed before on this list, and I shot it down due to
>> the danger, however I think it may be possible to change the string
>> representation to always include a \0 at the end, so that passing it
>> to C will simply be a matter of passing a pointer.
>
> +1 to that.
>
>> The danger could be avoided by a taint bit: if the string is known
>> to not contain \0, it can be passed directly.  Otherwise, it needs to
>> be checked and marked if it's safe.  If it's unsafe, an exception can
>> be thrown.
>
> IMO the better approach is simply to forbid NUL in strings altogether.
> It has no semantics as a character: there is never any situation in which
> you need the NUL character as opposed to the 0 byte in a bytevector.
> The R7RS was worded to allow implementations to do this.

I must confess I didn't read the entire thread. But, what exactly buys
us barring NUL in strings other than limiting the usefulness of the
type and its powerful API (while breaking a lot of things along the
way)? Also, NUL is a valid UTF-8 character.

Regards,
Michele



reply via email to

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