#339 Evaluation of array names

closed
nobody
Lisp Core (471)
3
2010-11-22
2003-07-07
No

Set var0:'var1, var1:'var2, var2:'var3, var3:'var4

Now

var0[x] => var4[x]

In other words, it re-evaluates the array name until it
can no longer be evaluated.

This does not seem to be documented and I don't see
the rationale for this.

Discussion

  • Robert Dodier

    Robert Dodier - 2006-07-07
    • labels: --> Lisp Core
     
  • Dieter Kaiser

    Dieter Kaiser - 2010-11-10

    I think the multiple evaluation is not a problem of array names, but of subscripted variable names. Maxima has the undocumented property 'nonarray to handle the names of subscripted variables different from array names.

    (%i1) var0:'var1$ var1:'var2$ var2:'var3$ var3:'var4$

    This is the default behavior:

    (%i5) var0[x];
    (%o5) var4[x]

    If we declare the variable var0 to be a 'nonarray, we get:

    (%i6) declare(var0,nonarray)$

    (%i7) var0[x];
    (%o7) var0[x]

    Unfortunately, the function featurep does not know this property:

    (%i8) featurep(var0,nonarray);
    (%o8) false

    Perhaps we should document the behavior of subscripted variable names and the property 'nonarray, which prevents the multiple evaluation. In addition we could extend the function featurep to handle the property 'nonarray.

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-11-22

    Documentation about the property nonarray has been added in Expressions.texi revision 1.71.
    Closing this bug report as fixed.
    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-11-22
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks