1. Re: type string

Hmmm... you have a point with the ASCII-zero limitation, Daniel. My =
initial thought was that I wouldn't want to use a string type that =
didn't allow 0 as a character. But I think that's just a holdover from =
when I used strings in BASIC to manipulate data, and having 0 as a =
string character was crucial. There's really no point in Euphoria--if =
you want to manipulate data, a sequence should work fine, and a true =
string with a zero in it won't print out properly in Euphoria anyway.

But it would be a pitfall to me to use a type that allowed floats as =
characters; the only time I would ever drop a decimal number into a =
string would be on accident (although I'm sure others take advantage of =
the flexibility all of the time.)


Rod Jackson

----------
From:   Daniel Berstein[SMTP:daber at PAIR.COM]
Sent:   Saturday, March 13, 1999 11:48 AM
Subject:        Re: type string

At 03:07 AM 13-03-1999 , you wrote:
>Daniel, I ran string6() and your version of string() above thru the
>strbench.ex program you posted earlier, and string6() wins every time!
>
>It's because the "not sequence(s)" and "integer(c)" tests are crucial =
to the
>edge that string6() has. Every time I changed one or the other to what =
you
>suggested, the speed dropped. [Using "c<1" instead of "c<0" made no
>significant difference.]
>
>
>Running on a PII 200mHz in DOS under WinNT:
> -------------------------------------------
>ex strbench 100000 6
>
>string6z() - 0.001285 "c<0" replaced with "c<1"
>string6()  - 0.001288
>string6s() - 0.001304 "not sequence(s)" replaced with "atom(s)"
>string6i() - 0.001324 "integer(c)" replaced with "atom(c)"
>string()   - 0.001344
>
>
>The far-right digit varied a little, but the other digits remained the =
same
>every time.
>
>Now, I know that Euphoria allows fp values for its string chars, but is =
it
>*really* necessary for the string() type to allow them, too? It's the
>biggest speed-killer of the bunch (string6i above).

The point of my suggestion wasn't speed, but compatibility with =
Euphoria's
way to treat sequences. I believe that it must test for atoms in the =
range
of 1..255 to be a true Euphoria string type, otherwise it would be a =
subset
of Euphoria supported string values.

BTW I avoided some of the randomness of the benchmark under NT using
exw.exe instead of ex.exe (and the numbers returned are much more "real"
than those 0.00xxx seconds ex.exe gives).


Regards,
          Daniel  Berstein
         [ daber at pair.com ]

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu