Flaw in Euphoria routines (Was: Re: puts() quirk)
- Posted by jbrown105 at speedymail.org Apr 23, 2003
- 399 views
On Wed, 23 Apr 2003 08:50:56 -0400, Sabal.Mike at notations.com wrote: > Actually, this makes perfect sense. Strings in most C-based modern > languages are null terminated. Any bytes after the null are considered > garbage and thus not part of the string. Since Euphoria's string > handling is largely based on C routines, the first puts will see > "cat\0\0\0\n", will see the first null (\0) and will stop the string at > that point. Since it never saw the newline, it never printed it. The > same is true for your second example. > > HTH, > Mike Sabal But I feel, that since Euphoria does not have null-terminated strings, that is a bug. (Though, this can be considered stretching the issue a bit, considering Euphoria has no strings at all, just sequences, and that the closest thing to a real string in Euphoria has to be manipulated via the peek()/poke() primitives). This is perhaps not an easy fix though, considering the Euphoria interpreter is written in C ... short of making OS calls directly and bypassing the C library, or using C++ (somehow), I'm not aware how this could even be fixed. jbrown -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again