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

Close

#356 redefining built-in functions (binom)

closed
nobody
Lisp Core (472)
5
2009-11-07
2003-07-12
Stavros Macrakis
No

This is a documentation issue, an error message issue,
and a semantics issue....

binom() is defined as an alias for binomial(), but this is
not mentioned in the documentation. I wanted to use
binom for the explicit form (in terms of factorials) and
when I said

binom(a,b):=...

was surprised to get

Warning - you are redefining the MACSYMA command
BINOMIAL

This redefines the verb form, but not the noun form, so
if you now enter binom(2,x), you get back binomial(2,x),
and NOT 2/((2-x)!*x!). You can only get that using ev
(...,binomial) or by explicitly using verbify(binomial).

This is all rather unintuitive. I think that more "natural"
ways to do things would be either:

1) forbid redefining built-ins;
or
2) when they're redefined, remove their simplification
properties etc. and have them operate like normal
functions;
or
3) at least remove the alias which makes it function as
the noun form on input

Discussion

  • Raymond Toy
    Raymond Toy
    2003-07-29

    Logged In: YES
    user_id=28849

    For option 1, perhaps we can use the package locks that are
    available in Clisp and (CVS) CMUCL. This will cause a
    (Lisp) error to occur on redefining symbols in the Maxima
    package.

     
  • Robert Dodier
    Robert Dodier
    2006-07-08

    • labels: --> Lisp Core
     
  • Robert Dodier
    Robert Dodier
    2006-07-08

    Logged In: YES
    user_id=501686

    I'm inclined to recommend (2) and (3) because (1) conflicts
    with Maxima's general laissez-faire attitude.

     
  • Dieter Kaiser
    Dieter Kaiser
    2009-11-07

    The predefinition of binom to be an alias of binomial has been cut out. If needed, the Maxima user can use the function alias to get this definition.
    Closing this bug report as fixed.
    Dieter Kaiser

     
  • Dieter Kaiser
    Dieter Kaiser
    2009-11-07

    • status: open --> closed