Re: 2.6 feature request: foreach (off topic)
- Posted by ags <eu at 531pi.co.nz>
Jul 15, 2005
Juergen Luethje wrote:
> b) A "2-dimensional sequence" in Euphoria could look like this:
> s = {
> {1},
> {7,8,12,-3,12},
> {9,5}
> }
>
> AFAIK storing these data in a BASIC array would look something like
> this:
> a = {
> {1,0, 0, 0, 0},
> {7,8,12,-3,12},
> {9,5, 0, 0, 0}
> }
>
> IOW, there will have to be several additional elements with value 0
> or something, wich are not needed at all, but which waste space of
> course.
I don't think that's a fair comparison. Quite often the reason for having
a 2D array is if you want to access the array as a[x][y], if this is the
case then you still need place-holders in Euphoria.
But who is worried about memory these days, really? We're talking about a
language used on 32-bit Windows and *nix. If we were talking embedded
applications things might be a bit different, but as long as memory use isn't
totally abused, you may as well use it; the OS will see to it that you don't
run out of fast memory.
Gary
|
Not Categorized, Please Help
|
|