[Chicken-users] Question about COOPS, generic methods, and modules
From:
Taylor Venable
Subject:
[Chicken-users] Question about COOPS, generic methods, and modules
Date:
Wed, 22 Sep 2010 21:06:33 -0400
Hi there!
I found this while writing some code for work earlier (I'm lucky enough to be able to write testing programs in the language of my choice). I define a class and a generic method in a module in a file, then load it into the REPL. I can make an instance of that class, binding it to a variable at the toplevel, and use the generic method just fine. If I then reload my code, I cannot use the generic method with the bound instance: I get the "no method defined for given argument classes" error. If my class and generic method definitions are not in a module, everything works fine. I'm wondering if this is me misunderstanding something, or it is intentional behaviour, or maybe it's a bug. Here is a concrete example:
I'm using Chicken 4.6.1 (git 7ac10a2fb9b04d114af97d8c9918bffae38cc534) on Linux AMD64 with COOPS 0.8 to test this. I notice that you get the warning about automatically defining the generic method twice, at each load, maybe that's indicative of the problem? Is there a way to make this work? Thanks.