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

*To*: Bradley Lucier <lucier@xxxxxxxxxxxxxxx>*Subject*: Re: Circular structures [was Re: IEEE 754 floating-point arithmetic is not completely ordered]*From*: Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx>*Date*: Mon, 18 Apr 2005 22:31:56 +0200*Cc*: Sebastian Egner <sebastian.egner@xxxxxxxxxxx>, srfi-67@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-67@xxxxxxxxxxxxxxxxx*In-reply-to*: <6f0cce550e37fed26fbb751c40781b93@xxxxxxxxxxxxxxx>*References*: <y9ld5sux2j1.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <426134F8.3070307@xxxxxxxxxxxx> <6f0cce550e37fed26fbb751c40781b93@xxxxxxxxxxxxxxx>*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:Bradley Lucier 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"?

"Almost all" should be interpreted in the view of the design rationale in the section "How to define default-compare?". We are excluding objects such as closures and continuations, where the only portable comparison operator available is eq?. If an implementation offers additional possibilities (say based on hash codes and pointer magic) then they could provide refined compare function. We encourage implementors to refine default-compare on implementation specific values such as such as values representing regular expressions.

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 Is default-compare compatible with equal?

We have on purpose left the result of default-compare unspecified when one of the arguments is circular. Testing circularity is expensive to do in a portable way. -- 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

- Prev by Date:
**Re: IEEE 754 floating-point arithmetic is not completely ordered** - Next by Date:
**Circular structures [was Re: IEEE 754 floating-point arithmetic is not completely ordered]** - Previous by thread:
**Re: IEEE 754 floating-point arithmetic is not completely ordered** - Next by thread:
**Circular structures [was Re: IEEE 754 floating-point arithmetic is not completely ordered]** - Index(es):