Opened 15 years ago

Closed 14 years ago

#122 closed defect (wontfix)

tinyclos generic mechanism gets confused by a surplus of arguments.

Reported by: Tony Sidaway Owned by: Tony Sidaway
Priority: major Milestone:
Component: extensions Version: 4.2.x
Keywords: tinyclos generics Cc:
Estimated difficulty:

Description

(define-generic G)
(define-method (G (a <exact>)) (+ a a))
(G 10)
===> 20
(G 10 11)
Error: bad argument count - received 3 but expected 2: #<procedure (? call-next-method a)

The exact same bug also exists in the Chicken 3 tinyclos egg on Chicken 3.4.0

Change History (3)

comment:1 Changed 15 years ago by Tony Sidaway

To clarify, the generic dispatch mechanism should identify the call as one for which it has no applicable methods. It should not call a method unless that method is specified so as to accept the argument list presented.

Here's an example of the desired behavior as seen in another system based on tinyclos. The define-method syntax is slightly different but it's basically the same code.

stklos> (define-generic G)
;; g
stklos> (define-method G((a <integer>)) (+ a a))
;; g
stklos> (G 1)
2
stklos> (G 1 2)
Error:
error: no applicable method for #[<generic> g (1)]
in call (g 1 2)

(type ",help" for more information)

comment:2 Changed 15 years ago by Tony Sidaway

Owner: set to Tony Sidaway
Status: newaccepted

comment:3 Changed 14 years ago by felix winkelmann

Resolution: wontfix
Status: acceptedclosed

I close this, since I consider tinyclos obsolete, and because nobody seems to work on this anymore.

Note: See TracTickets for help on using tickets.