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 17:19:29 -0400
On Sun, May 10, 2009 at 4:54 PM, Oliver Kullmann
<O.Kullmann at swansea.ac.uk> wrote:
> On Sun, May 10, 2009 at 03:47:51PM -0400, Stavros Macrakis wrote:
>> 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.
>>
> But you haven't give yet any example of a problem (not to mention there is
> apparently not a single use-case of somebody actually having a problem).
I gave the example below. Apparently I didn't express clearly enough
why that example is problematic.
>> > ...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.
> I know your e-mail,
Then it was inappropriate for you to say that I never gave any reason.
To say that you disagreed with the reason or didn't understand it or
whatever -- fine -- but to accuse me of "having a problem" and "never
giving any reason" is just not honest.
> (a:1,b:2,c:3,d:4)$
> create_list([i,j], i, a, b, j, c, d);
> ?[[1,3],[1,4],[2,3],[2,4]
> (a:[1,2],j:[3,4],d:[5,6])$
> create_list([i,j], i, a, b, j, c, d);
> ?[[1,[3,4]],[1,[3,4]],[1,[3,4]],[1,[3,4]],[2,[3,4]],[2,[3,4]],[2,[3,4]],[2,[3,4]]]
>
> Where is the problem? This is exactly as it should be.
The problem is that the meaning of the arguments depends on their
values. This is just poor practice. Think of it in terms of
compilation if you like: how would you compile
create_list(a,b,c,d,e,f,g)?
> P.S. Isn't this Lisp? In the context of programming languages
> like Java or C I could understand that this wouldn't fit into the flow
> of the language, but create_list perfectly fits into what one (or at least I)
> expects from Lisp.
Just because Lisp allows one to do certain things that Java doesn't,
doesn't make it a good idea to do them. As I mention above, besides
the loss of clarity, there is the problem of efficient compilation
(and Maxima and Lisp *do* support compilation...)
-s