Re: Big String Idea for v2.6

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

Al Getz wrote:
> All one would need is a simple function that gets the pointer
> to the sequence element and the above code would reduce to something
> like this:
> 
> String="ThisName"
> retv=c_func(xSetName,{pointer(String)})

As I've said before, I don't intend to ever give you a 
function that will tell you the address of a Euphoria 
variable in memory. Of course you'd also need to know 
the exact bit and byte layout of the variable, and this
would have to be defined in the manual.

I firmly believe this would be a very bad thing to do:

* I wouldn't be able to move a variable to a new location
  in memory (e.g. garbage collection).

* I might not be able to store two variable values in the same
  place in memory.

* I wouldn't be able to change the internal representation
  of Euphoria values in memory.

* ugly corruption bugs, and hard to read code would result

You could assume that all elements of a string sequence are 4-byte
values in Intel byte order, but this is not necessarily true 
today (some could be floating-point values), and could change drastically 
in the future, e.g. on a non-Intel machine. Suppose I (or some other 
implementer of Euphoria) wanted to use one-byte or one-bit per element 
in the future in some cases?

There's just no way that I want to expose this information
to your program. Euphoria is a language of values, not bits,
bytes and storage locations. You can peek and poke, but only
with your own blocks of memory, not with Euphoria variables.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu