#870 equal function

Lisp Core (471)

is(equal(true,true)) will return true
is(equal(false,false)) will return false
is(equal(true,false) or is(equal(false,true))
will give a bug ... syntax error.

Why not provide a k_delta function like in
Macsymas? e.g.

k_delta(true,false) returns false
k_delta(true,true) returns true
k_delta(1,1) returns 1
k_delta(1,0) returns 0

v 5.9.1 Maxima

Comment: there are some good features in
Maxima especially on Random(n).
Macsymas only give a ceiling of n = 10^8.


  • Nobody/Anonymous

    Logged In: NO

    The problem is that at present Maxima attempts to decide all
    equal (and notequal) comparisons as if the arguments were
    comparable numbers. This policy fails with errors of
    different sorts when the arguments are incomparable (e.g.,
    boolean, complex, or matrices).

    MEQP in src/compar.lisp calls COMPARE (numerical comparison)
    if LIKE (structural comparison) fails; it should instead
    call COMPARE only if the arguments are comparable.

    I can't see a good way to determine comparability. Probably
    it is OK to assume comparability if incomparability can't be
    established. Even this weak policy is problematic, due to
    the weakness of the assume / declare database system. It
    seems we should be able to let comparable = not featurep(x,
    real) or maybe featurep(x, nonscalar) or maybe testing for
    various domains featurep(x, complex) or featurep(x, boolean)
    or .... but various problems immediately crop up, e.g.,
    featurep(matrix([1, 2]), nonscalar) => false,
    featurep(matrix([1, 2]), real) => true, no built-in boolean
    property (and therefore true and false aren't boolean),
    featurep(1 + %i, nonscalar) => false, (declare (foo,
    nonscalar), featurep (foo(x), nonscalar)) => false, etc etc.

    Robert Dodier

  • Robert Dodier

    Robert Dodier - 2006-08-15

    Logged In: YES

    Boosting the priority of this one. It's really obnoxious.

  • Robert Dodier

    Robert Dodier - 2006-08-15
    • labels: --> Lisp Core
    • priority: 5 --> 8
  • Robert Dodier

    Robert Dodier - 2006-12-19
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks