From b3cc02cfd000ed942cd81998fe0c7669c72a4ed8 Mon Sep 17 00:00:00 2001
From: John Lenz
TinyCLOS has a limitation such that generic methods do not properly work on methods +
In Chicken versions equal to or below 1.92, TinyCLOS has a limitation such that generic methods do not properly work on methods with different number of specializers: TinyCLOS assumes that every method added to a generic function will have the same number of specializers. SWIG generates functions with different lengths of specializers when C/C++ functions are overloaded. For example, the code
@@ -571,13 +573,12 @@ int foo(int a);Using unpatched TinyCLOS, the second (define-method) will replace the first one,
so calling (foo 3 f) will produce an error.
There are two solutions to this: the +
There are three solutions to this. The easist is to upgrade to the latest Chicken version. Otherwise, the file Lib/chicken/tinyclos-multi-generic.patch in the SWIG source contains a patch against -tinyclos.scm inside the chicken source to add support into TinyCLOS for multi-argument generics. +tinyclos.scm inside the 1.92 chicken source to add support into TinyCLOS for multi-argument generics. (This patch was accepted into Chicken) This requires chicken to be rebuilt and custom install of chicken. An alternative is the Lib/chicken/multi-generic.scm file in the SWIG source. This file can be loaded after TinyCLOS is loaded, and it will override some functions -inside TinyCLOS to correctly support multi-argument generics. This solution will work on any install of chicken. -Please see the comments at the top of both files for more information.
+inside TinyCLOS to correctly support multi-argument generics. Please see the comments at the top of both files for more information.