#2355 length()/part() of a number or an atom

None
closed
nobody
None
5
2012-12-10
2012-02-08
Edd Barrett
No

Is there any reason why the length of a atom or constant number can not be one?

As it stands, an error is thrown. This means that programs which (for example) iterate over terms of an expression have to handle atoms and numbers specially, when really they could be considered expressions of 1 in length whose part(expr, 1) would return the atom or number itself.

Thanks

Discussion

  • Robert Dodier
    Robert Dodier
    2012-12-10

    • status: open --> closed
    • milestone: --> None
     
  • Robert Dodier
    Robert Dodier
    2012-12-10

    Last time this topic came up (a few years ago), there wasn't much support for it. Speaking for myself, I can see reasons to adopt the proposed change, but the current behavior is pretty deeply embedded in Maxima. So at this point I'm inclined to just let it stand. Accordingly I'm marking this report "closed".