[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: Circular structures [was Re: IEEE 754 floating-point arithmetic is not completely ordered]*From*: Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx>*Date*: Fri, 22 Apr 2005 18:49:19 +0200*Cc*: srfi-67@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-67@xxxxxxxxxxxxxxxxx*In-reply-to*: <y9lsm1lsh94.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>*References*: <y9ld5sux2j1.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <426134F8.3070307@xxxxxxxxxxxx> <y9lsm1lsh94.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>*User-agent*: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Bradley Lucier wrote:

On Apr 16, 2005, at 10:53 AM, Jens Axel Søgaard wrote:

Well, it depends on what your goal is. ...Here are some potential goals: ...3) default-compare should define a total order on almost all SchemevaluesWhat is "almost all"? How do a and b compare in the following? [descartes:~/programs/folding/2] lucier% gsc loading /usr/local/Gambit-C/gambcext.scm Gambit Version 4.0 beta 12 > (define a (cons #f #f)) > (set-car! a a) > (set-cdr! a a) > (define b (cons #f #f)) > (set-car! b b) > (set-cdr! b b) > (equal? a b) ;;; doesn't terminate

In the proposal default-compare is not defined on circular structures. Theoretically I think (I am not sure though) it is possible to define an order on graphs.

Is default-compare compatible with equal?

The current proposal for default-compare is: (define (default-compare x y) (select-compare x y (null? 0) (pair? (default-compare (car x) (car y)) (default-compare (cdr x) (cdr y))) (boolean? (compare-boolean x y)) (char? (compare-char x y)) (string? (compare-string x y)) (symbol? (compare-symbol x y)) (number? (compare-number x y)) (vector? (compare-vector default-compare x y)) (else (error "unrecognized types" x y)))) Which means they are almost compatible :-) The return value of equal? of two non-eq? symbols with the same spelling is left unspecified by R5RS where as default-compare is required to return #t. Similary the return value of equal? of an exact number and an inexact number that are numerically equal unspecified. Apart from that, the domain of default-compare doesn't include e.g. procedures as equal? does. -- Jens Axel Søgaard

**References**:**Re: IEEE 754 floating-point arithmetic is not completely ordered***From:*Bradley Lucier

**Re: IEEE 754 floating-point arithmetic is not completely ordered***From:*Jens Axel Søgaard

**Circular structures [was Re: IEEE 754 floating-point arithmetic is not completely ordered]***From:*Bradley Lucier

- Prev by Date:
**Circular structures [was Re: IEEE 754 floating-point arithmetic is not completely ordered]** - Next by Date:
**Naming, compare function return values** - Previous by thread:
**Circular structures [was Re: IEEE 754 floating-point arithmetic is not completely ordered]** - Next by thread:
**Two maybe-bugs and two proposals** - Index(es):