makelist vs create_list



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