makelist vs create_list



On 4/9/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

>  create_list( [i,j],i,[i1,i2],j,[j1,j2])  => [    [i1,j1], ...
> cartesian_product({i1,i2}, {j1,j2})       => {    [i1,j1], ...
> create_list(f(i,j),i,[i1 ,i2],j,[j1,j2])  => [  f( i1,j1 ), ...
>  map(f,cartesian_product({i1,i2},{j1,j2}))=> {  f([i1,j1]), ...
>      (note sets and list argument)
> outermap(f,[i1,i2],[j1,j2])              => [[ f( i1,j1 ),

Well, this is something of a mess. I hope we can avoid making it any worse ....

> > But now I'm wondering --- is makelist w/ multiple arguments
> > supposed to be like map or like cartesian_product or outermap?
>  > Or something else?
>
>  They all seem useful.  It would, on the other hand, be nice if we had a
> systematic approach to all this using fewer primitives which would combine
> nicely, or at least had systematic names.

Sure. I'm still wondering, though, if the extended makelist would be
more like map or more like cartesian_product. I'm in favor of making
it more like map.

FWIW
Robert