Option variable $subscrmap



The option variable $subsrcmap is not documented. The variable is used
in the routine MEVAL1. I have tried to figure out the intended use.

I think the flag is intended to do something like

   a[matrix([1,2])] -> matrix([a[1], a[2]])

The index of a symbol can be a list or a matrix. If $subscrmap is T, the
symbol is mapped over the list or matrix. The mapping is done by the
function subgen in comm2.lisp.

But the code is broken and does not work:

(%i5) a[matrix([1,2])],subscrmap:true;
Subscripted variable found with no subscripts.
 -- an error. To debug this try: debugmode(true);

We can improve this and we will get the following results:

(%i7) a[matrix([1,2])],subscrmap:true;
(%o7) matrix([a[1],a[2]])

(%i8) f[[x,y,z]],subscrmap:true;
(%o8) [f[x],f[y],f[z]]

To get the above behavior we have to switch off the simplifer in the
routine subgen. Perhaps, there is a more elegant way to correct the
code, but it works.

It does not work for an array function:

(%i15) f[[x,y,z]](x),subscrmap:true;
apply: found [f[x],f[y],f[z]] where a function was expected.
 -- an error. To debug this try: debugmode(true);

We have two options:

1. improving the code and adding the documentation for $subscrmap
2. cutting out this functionality

Opinions?

Dieter Kaiser