proposal to modify op and args



Am 7 May 2006 um 12:38 hat Robert Dodier geschrieben:

> Hello,
> 
> At present the functions op and args barf on atoms.
> I propose that op and args return false when the argument is an atom.
> 
> This change is intended to obviate the need to always test whether
> the argument is an atom before calling op or args.
> 
> I looked at the commercial Macsyma documentation, but it didn't
> say what op and args do when the argument is an atom.
> 
> Comments?
> 
> Robert Dodier

Hi Robert,

generally a good idea. I would be nice to have a return value instead of an error.

What is the advantage of returning false? Another possibility would be

op(<atom>);  --> < identity function>
args(<atom>);  -->  <atom>

Example: 
map( 'args, [ a, b^2 ] );   -->  [ [a], [b,2] ]

Volker