Again $table function, speed/functionality improved
Subject: Again $table function, speed/functionality improved
From: Žiga Lenarčič
Date: Wed, 13 May 2009 18:59:48 +0200
On 13. May, 2009, at 6:41 PM, Robert Dodier wrote:
> On Wed, May 13, 2009 at 7:09 AM, ?iga Lenar?i?
> <ziga.lenarcic at gmail.com> wrote:
>
>> Any comments on $table implementation? Any comments on the
>> function name?
>> Anything needs changing before this gets into Maxima?
>
> I'm not 100% sure we want to import "table", and I'm not in a hurry
> to come to a decision. That said, I'd be more interested if we can
> replace makelist and create_list. It would be nice to have a more
> extensive list-making function, but I don't like having a multitude of
> functions which do similar things.
I understand your concern (even right now, we have create_list and
makelist)...
One idea I had is, table could be called makelist - it is not hard to
recognise if it is a $makelist call or $table call if you look at the
arguments. The most simple method would be to look at second
argument, and if it's a list call $table internally, if it is not a
list, call the old $makelist. This can get messy though!
Otherwise building upon current $makelist and $create_list is not
wise in my opinion - the calling sequence of makelist(expr, var,
start, end); can not be extended into something as flexible as $table
offers.
Table can be a replacement for these two, which cannot be changed
without breaking compatibility with existing programs (or can they?).
In documentation there could be a note that one should rather use
table than makelist and create_list and eventually they could be
removed... (that's my most realistic view of solving this
makelist,create_list,table mess)..
Ofcourse there's no hurry to put $table in, but I think many people
would benefit if it appeared in the next version in some form...
> "tabulate" is a better name, I think --- it is an imperative
> like makelist or create_list (or expand, subst, etc).
Probably the most important thing in the end is that the name is
short :), not cryptic and easy to remember.. something with lists
would be nice.. I like the fact that 'table' is shorter than
'makelist', but I don't like the fact that the name is stolen from
Mathematica and has nothing to do with lists.
>> A similar function could be written for arrays - if Maxima ever
>> gets a
>> better array support (like amatrix package).
>
> Well, I wouldn't bother trying to wedge array stuff into "table" at
> this point.
> Maxima generally doesn't know what to do with arrays as it stands.
> I think it would be better to come up with a plan to improve array
> stuff across the board.
I agree - it would be very nice if Maxima's support for arrays would
improve... in ideal case they shouldn't be harder to use than lists.
> FWIW
>
> Robert Dodier
Regards,
Ziga Lenarcic