Re: Some changes I'd like to see

new topic     » goto parent     » topic index » view thread      » older message » newer message

> On Wed, 2 Feb 2000 12:39:15 +1300, The Johnson Family <thedjs at INAME.COM>
wrote:
>
> ><Snip...>
> >> STRINGS:
> >> Implementing a string type will allow Euphoria to store "Hello World"
as
> >> "Hello World" (13 bytes)
> >> instead of {72,101,108,108,111,32,87,111,114,108,100} (42 bytes)
> >> thus preventing menory and disk from getting that uncomfortable bloated
> >> feeling.
> ><Snip...>
> >AFAIK (As Far As I Know), the string "Hello World" is stored in memory as
> >"Hello World", not as the euphoria sequence. This is just euphorias way
of
> >displaying sequences in an easy to read form, and printing to disk is
just
> >another type of displaying, as far as euphoria is concerned. Of course,
> >printf can be used to ovveride the default display method.
> >
> >Nick
>
> Well, we're really not supposed to know how it is stored in memory, but
the
> good book( the Euphoria documentation) indicates sequences and strings
> are one and the same thing and there is no real distinction between the
> binary numbers that represent ASCII strings and the strings themselves.
> According to that logic, Irv has the right of it on this one.
>
> Everett L.(Rett) Williams
> rett at gvtc.com
>
Hold on just a mo, Irv is saying that if we 'looked' into the memory, we
would see the character codes for {72,101,108,108,111,32,87,111,114,108,100}
(42 char codes) instead of just the character codes for "Hello World". What
I gather from the manual is that yes, characters and integers are stored the
same, but they are not stored in memory as ASCII text - the number 65535
would not consist of character codes for each character (6, 5, 5, 3, and 5),
but as a 2 byte binary number. The same with character codes - they would be
stored as a 1 byte binary number for each character. Am I making sense here?
Maybe RDS can sort this out for us, because if things are stored in Mem as
Irv suggests, numbers are stored even less efficiently than strings, using 8
bits per decimal digit.

Nick

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu