On Sun, Jun 10, 2007 at 04:49:58PM -0400, William D Clinger wrote:
> John Cowan wrote:
> > Specifically, make-enumeration should return a unique opaque
> > enumeration-type object. This would then be accepted by
> > enum-set-{universe, indexer, constructor} and the procedures returned
> > by the latter two. Each enumeration-type object would be distinct in
> > the sense of eqv? from any other (so eqv? would need a new reference to
> > library section 14).
>
> If this is to be considered, then I would suggest
> going further and requiring any two enumeration-type
> objects whose universes represent the same set of
> symbols to be eqv? and interchangeable with respect
> to all of the enumeration-set operations.
That strikes me as "interesting" to implement, given that the order
in which the symbols are passed to make-enumeration (after duplicate
removal, if needed) is considered the "canonical order" and is used by
enum-set-indexer and enum-set->list.
Under your suggestion, two enumeration sets differing only in the order
in which their symbols are passed to make-enumeration would have to be
transparently interchangeable, meaning that they'd have to do something
like sort the symbols and use that order internally, while retaining the
permutations involved in order to reconstruct the original "canonical"
orders for enum-set-indexer and enum-set->list.
Also, as the enumeration types could thus be distinguished by obtaining
their universes and converting them to lists, making them eqv? seems
inappropriate.
These objections would not apply to equivalencing any two enumeration
types representing the same *sequence* of symbols (which would be
sufficient to make make-enumeration referentially transparent, I think,
for whatever that's worth).
--
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l)))))) (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k))))))) '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))
Received on Mon Jun 11 2007 - 01:55:16 UTC