April 22, 2005
TechnoZeus wrote:
<snip>
> Hmmm... Now you have me curious.  Why couldn't a reverse direction slice be a slice into the array?  It would seem to me that there should be nothing preventing it.

1. It would require an extra piece of information to be stored about each array: the direction in which it goes in memory.  Which would mean a change in the ABI - either add a direction field (increasing memory requirements), or make length an int (instead of uint) with the sign denoting direction (decreasing the maximum length of an array).

2. Checking the direction might slow programs down a little.

3. Code that extracts pointers from arrays (either to mark a point in the array or to interface with an external API) will break if the array is backwards in memory.

It could be done with Norbert's long-standing MDA proposal, but wouldn't make a practical addition to plain linear arrays.

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on
the 'group where everyone may benefit.
April 24, 2005
Ah, okay.  Didn't realize that an unsigned int was used.

TZ

"Stewart Gordon" <smjg_1998@yahoo.com> wrote in message news:d4ai31$2525$1@digitaldaemon.com...
> TechnoZeus wrote:
> <snip>
> > Hmmm... Now you have me curious.  Why couldn't a reverse direction slice be a slice into the array?  It would seem to me that there should be nothing preventing it.
>
> 1. It would require an extra piece of information to be stored about each array: the direction in which it goes in memory.  Which would mean a change in the ABI - either add a direction field (increasing memory requirements), or make length an int (instead of uint) with the sign denoting direction (decreasing the maximum length of an array).
>
> 2. Checking the direction might slow programs down a little.
>
> 3. Code that extracts pointers from arrays (either to mark a point in the array or to interface with an external API) will break if the array is backwards in memory.
>
> It could be done with Norbert's long-standing MDA proposal, but wouldn't make a practical addition to plain linear arrays.
>
> Stewart.
>
> -- 
> My e-mail is valid but not my primary mailbox.  Please keep replies on the 'group where everyone may benefit.


1 2
Next ›   Last »