|
robert bristow-johnson wrote:
>
> AJ \"no z\" Johnson wrote:
> >
> > "Steve Amphlett" <samphlett@ricardo.com> wrote in message
> > news:2ae8f62b.0208140017.65bb9cd3@posting.google.com...
> > > Oh well guys, the thread's now four days old and still no TMW
> > > chippers-in! Do you reckon they're developing their killer argument?
> > > Or are they just sitting pretty, knowing that their obviously flawed
> > > product has market share on its side?
> > >
> > > - Steve
> >
> > ...or maybe they are too busy adding an "Index Origin" property to array
> > constructs. One can only hope. I hope it's obvious which court I'm in.
>
> it's nice to feel less alone. when i first brought this up, it seemed
> like everyone, except a few comp.dsp regulars, thought i was goofy.
Now, who... would think that. ;)
Responding to this and the another thread, here in one place.
Take a look at Python. I haven't played with 2.2, but in 1.5 and with
numpy, there is a distinction between an array(n) and a
array(n,1). You can also have an array with indicies
a('bob', 'ted', 'carol', 'alice')
if you want. The iterator in this case brings a few ideas to mind, but
I won't go there.
It seems like you would like something of the flavor of an associate
memory.
In terms of matricies, zero base indexing might be a bit cleaner in
terms of notation for cyclic objects i.e. a( mod(i,N))
>
> > This being the first indexing thread that *I've* read, I am curious what
> > other languages support definable indexing origins?
> > For sure:
> > - Maple (don't know much about it, though)
> > - Pascal, IIRC
> > - APL (choice of 0 or 1 only)
> > - C (array indexing is so loose that one can implement non-zero based
> > indexing, but it is geneally considered bad coding practice)
>
> i don't consider it bad coding practice, at all. i used to do this:
>
> double _my_dummy_array1[1024];
> double my_array[1];
> double _my_dummy_array2[1024];
>
> for (k=-1024; k<=1024; k++)
> {
> do_something_with( my_array[k] );
> }
>
> ****but i was thoroughly chewed out for that since there was no way to
> guarantee that the compiler would put the arrays together like that.
> but if you do:
>
> double *_my_dummy_array = (double *)malloc(2049*sizeof(double));
> double *my_array = _my_dummy_array + 1024;
>
> for (k=-1024; k<=1024; k++)
> {
> do_something_with( my_array[k] );
> }
>
> ****that should be perfectly acceptable coding practice.
>
> > I think Mathworks has gone a long way to meeting customer demands, which is
> > why it's such a comprehensive product now. If only they'd add *my* stuff...
>
> elegance, consiseness, and simplicity is more important to me than
> everything with the kitchen sink. i use very few of the huge set of
> MATLAB functions. i just want them to work correctly.
>
> --
>
> r b-j
> rbj@surfglobal.net a.k.a. robert@wavemechanics.com
>
> "Don't give in to the Dark Side. Boycott intel and microsoft."
|