[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: findgen([variable])



Craig Markwardt wrote:
> 
> JD Smith <jdsmith@astro.cornell.edu> writes:
> 
> > Craig Markwardt wrote:
> > >
> > > Martin Skou Andersen <skou@fys.ku.dk> writes:
> > > > Is it posible to make an mutiple dimensional array by using a variable
> > > > such as findgen(x)?
> > >
> > > This is virtually impossible, right?  You are asking for each row of
> > > the resulting array to be of a different length.  That's not really a
> > > 2 dimensional array is it?
> >
> >
> > Are we sure he doesn't just mean:
> >
> > findgen(x[0],x[1]) ?
> 
> Ah yes, that would be a good idea.  In fact, one of my "top ten"
> requests was to have all of the functions that accept dimensions,
> accept them in a consistent way.  REBIN, REFORM and TOTAL are all
> different.  We should be able to specify dimensions consistently
> between them, and either as an array, or a list of scalars.

Or as either, as in Perl, where 

@a=($a1,$a2);
sub(@a);

sub($a1,$a2)

are the same.  A list is a list is a list.  This simplifies a lot of
things (and of course requires atomic list members (i.e. pointers),
since you can't have separate lists and scalars all on the command
line).  

Not that we could ever get away with that kind of facelift, but PerlDL
of course has hope.

JD