Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#986 declare refuses subscripted variables and other non atoms

open
nobody
7
2012-11-18
2006-09-12
Robert Dodier
No

declare refuses subscripted variables and other non
atoms. E.g.

(%i25) declare (foo[1], integer);

Improper argument to declare:
foo[1]

declare should at least recognize variables with
literal subscripts (e.g. foo[1], bar[2], baz[3]).

declare might also recognize other kinds of expressions
such as variable subscripts (e.g. foo[n]), unevaluated
function calls (e.g. foo(x)), or maybe arbitrary
expressions (e.g. sin(foo(x) + bar[y]) + baz).

At present declarations are stored in the property list
of the symbol for the declared symbol. I don't know how
we would modify that to store declarations for nonatoms.

Discussion

  • Robert Dodier
    Robert Dodier
    2006-09-12

    Logged In: YES
    user_id=501686

    Need to review featurep and beef it up to look for
    properties associated with foo[1] or whatever, if it can't
    do that already.

     
  • Barton Willis
    Barton Willis
    2006-09-13

    Logged In: YES
    user_id=895922

    It would be nice to ditch Maxima's property list scheme for
    storing information and place all such data into hash
    tables. But Maxima uses mget, zl-get, safe-get, safe-mget,
    get, and maybe other methods for retrieving data from
    property lists, so changing to hash tables could be a big
    job and cause lots of bugs.

    We could have subscripted variables inherit the properties
    of the subscribed symbol; thus n[1] is an integer if n is a
    declared integer. But if 'x' was declared nonscalar, few
    would like for x[1] to also be nonscalar.