New function - makelist alternative: table()ing Lisp ECL 9.4.1
Subject: New function - makelist alternative: table()ing Lisp ECL 9.4.1
From: Stavros Macrakis
Date: Sun, 10 May 2009 15:47:51 -0400
On Sun, May 10, 2009 at 3:14 PM, Oliver Kullmann
<O.Kullmann at swansea.ac.uk> wrote:
> On Sun, May 10, 2009 at 03:07:44PM -0400, Stavros Macrakis wrote:
>> As I have documented before, create_list has a fatal design flaw:
>> ambiguous syntax, unlike Ziga's 'table', which is unambiguous. ?I
>> would recommend that create_list be removed from the system after
>> table is fully integrated.
> sorry, but that's nonsense: create_list is the single most useful
> function in Maxima! In my system I use it in likely over 1000 places,
> and I NEVER encountered any problem (different from the rest of Maxima).
Just because one user never encountered a problem does not mean there isn't one.
> ...I know you have a problem with create_list, but you never
> gave any reason except of your repeated statement.
You may disagree with me, but accusing me of not giving any reason is offensive.
I first stated my objections to create_list on this list on Apr 7,
2007 and forwarded them to the list again on Oct 12, 2008. See below.
The problem with the syntax is that the meaning of create_list (which
arguments are variables and which are values) depends on the *actual
value* of the arguments.
-s
---------- Forwarded message ----------
From: Stavros Macrakis <macrakis at alum.mit.edu>
Date: Sun, Oct 12, 2008 at 8:59 PM
Subject: Re: [Maxima] evaluation
To: pdl at johnlapeyre.com
Cc: maxima at math.utexas.edu
The implementation of makelist should no doubt be rethought.
However, using create_list instead of makelist would be a very bad
idea, because create_list has a fatal flaw in its semantics (not its
implementation). See my email below. Create_list should be
redesigned to avoid this flaw.
-s
On Sun, Oct 12, 2008 at 8:22 PM, John Lapeyre <pdl at johnlapeyre.com> wrote:
>
> On Sunday 12 October 2008 01:00:46 pm Stavros Macrakis wrote:
>
> > >... makelist should probably be rewritten
> > It sounds like that would be a good idea.
>
> ... makelist appears to be older than create_list. But I suspect create_list
> would work as a drop in replacement for the majority of the cases in share....
---------- Forwarded message ----------
From: Stavros Macrakis <macrakis at alum.mit.edu>
Date: Sat, Apr 7, 2007 at 9:49 AM
Subject: Re: [Maxima] makelist vs create_list
To: Kostas Oikonomou <ko at research.att.com>
Cc: Maxima <maxima at math.utexas.edu>
On 4/6/07, Kostas Oikonomou <ko at research.att.com> wrote:
>
> ...I'm wondering why Maxima has both makelist() and create_list().
Bad design. Of course there shouldn't be two redundant functions like this.
There is also a serious problem with the design of create_list. Its
generalization to multiple variables is very useful and unproblematic.
On the other hand, the fact that it allows either lists or ranges
defined by integers makes its semantics weird, with the interpretation
of its arguments depending on their values. Consider:
(a:1,b:2,c:3,d:4)$
create_list(i*j, i, a, b, j, c, d) => [3,4,6,8]
vs.
(a:[1,2],j:[3,4],d:[5,6])
create_list(i*j, i, a, b, j, c, d) =>
[[3, 4], [3, 4], [3, 4], [3, 4], [6, 8], [6, 8], [6, 8], [6, 8]]
This is disastrously poor design. With identical syntax, in the first
case, i and j are treated as variable names; in the second case, i, b,
and c, are considered as variable names. We should remove the "range
defined by integers" case from create_list.
-s