bug#37461: define-generic doesn't promote equal? to generic

2019-09-28 Thread Rob Browning
Mikael Djurfeldt writes: > You see, I was under the impression that primitive-generic capability had > been removed for equal?. It has not. It's only the printed representation > which has changed. Ahh, right -- that confused me at first too. > One way to view this is that the dispatch of

bug#37461: define-generic doesn't promote equal? to generic

2019-09-28 Thread Mikael Djurfeldt
On Mon, Sep 23, 2019 at 5:01 PM Mikael Djurfeldt wrote: > > (define-method (equal? (a ) (b )) ...) > > on the other hand, means that you want to *extend* the current behavior of > equal? with a specialization to two strings. The method is then added to > equal?, which in guile-1.8 was from

bug#37461: define-generic doesn't promote equal? to generic

2019-09-23 Thread Mikael Djurfeldt
Hi Rob, I left GOOPS development at Guile version 1.8. The way this was then intended to work was that (define-generic equal?) means that you want to create a new generic equal?. This discards the old binding for equal?. (define-method (equal? (a ) (b )) ...) on the other hand, means that

bug#37461: define-generic doesn't promote equal? to generic

2019-09-21 Thread Rob Browning
Rob Browning writes: > A re-export doesn't affect the module using the re-exporter, and export > and replace both fail with "Unbound variable: equal?", even though > there's a (define equal? ...) in the module. Perhaps there was something else going on, but now :replace does appear to work,

bug#37461: define-generic doesn't promote equal? to generic

2019-09-19 Thread Rob Browning
Rob Browning writes: > You can work around the problem by stashing equal? somewhere else, and > then define-generic will work after a (define equal? #f). Presumably > you'd then need to define a base specialization using the original > equal? or do something equivalent. It looks like while

bug#37461: define-generic doesn't promote equal? to generic

2019-09-19 Thread Rob Browning
Version: 2.2.6 scheme@(guile-user)> (use-modules (oop goops)) scheme@(guile-user)> equal? $1 = # scheme@(guile-user)> (define-generic equal?) scheme@(guile-user)> equal? $2 = # The same appears to be true for other primitives like + too, but if I'm reading it right, this makes it