Summary
tinyclos generic mechanism gets confused by a surplus of arguments.
Metadata
- Id: ab675a582b9eb824fbb79c9d856d7423b3fb4530
- Trac id: 122
- Type: defect
- Reporter: tonysidaway
- Owner: tonysidaway
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty:
- Resolution: wontfix
- Priority: major
- Milestone:
- Version: 4.2.x
- Changetime: 2010-12-11 13:19:28 UTC
- Created: 2009-11-15 17:51:08 UTC
- Keywords: tinyclos generics
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
Changes and comments
[2009-11-15 18:11:50 UTC] tonysidaway wrote:
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 #g (1) in call (g 1 2) (type ",help" for more information)
[2009-11-18 14:25:02 UTC] tonysidaway changed status from new to accepted
[2009-11-18 14:25:02 UTC] tonysidaway set owner to tonysidaway
[2010-12-11 13:19:28 UTC] felix changed status from accepted to closed
[2010-12-11 13:19:28 UTC] felix set resolution to wontfix
[2010-12-11 13:19:28 UTC] felix wrote:
I close this, since I consider tinyclos obsolete, and because nobody seems to work on this anymore.