#1430 array and scalar declarations yield inconsistent results

closed
nobody
Lisp Core (472)
5
2010-05-09
2008-06-05
Viktor Toth
No

The following example speaks for itself:

(%i1) scalarp(x);
(%o1) false
(%i2) scalarp(x[1]);
(%o2) false
(%i3) declare(x,scalar);
(%o3) done
(%i4) scalarp(x);
(%o4) true
(%i5) scalarp(x[1]);
(%o5) true
(%i6) array(x,5);
(%o6) x
(%i7) scalarp(x);
(%o7) false
(%i8) scalarp(x[1]);
(%o8) false
(%i9) declare(x,scalar);
(%o9) done
(%i10) scalarp(x);
(%o10) false
(%i11) scalarp(x[1]);
(%o11) false
(%i12) nonscalarp(x);
(%o12) true

I do believe that this is an unwanted side effect of array() that should probably be fixed. The problem seems to be specific to scalar/scalarp, for instance it doesn't affect constant/constantp.

Discussion

  • Dieter Kaiser
    Dieter Kaiser
    2010-05-09

    • status: open --> closed
     
  • Dieter Kaiser
    Dieter Kaiser
    2010-05-09

    Fixed in simp.lisp revision 1.108.
    The examples of this bug report now give consistent results.
    Closing this bug report as fixed.
    Dieter Kaiser