Pass closures, rather than primitive procedures, as #:slot-ref and

#:slot-set!.  Guile 1.6 only seems to like closures here.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5272 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Matthias Köppe 2003-11-06 15:49:10 +00:00
commit da0b1cc049

View file

@ -1617,11 +1617,15 @@ public:
String *goops_name = goopsNameMapping(proc, short_class_name);
Printv(goopscode, " (", goops_name, " #:allocation #:virtual", NIL);
Printv(goopscode, " #:slot-ref ", primRenamer ? "primitive:" : "",
short_class_name, "-", proc, "-get", NIL);
/* GOOPS (at least in Guile 1.6.3) only accepts closures, not
primitive procedures for slot-ref and slot-set. */
Printv(goopscode, " #:slot-ref (lambda (obj) (",
primRenamer ? "primitive:" : "",
short_class_name, "-", proc, "-get", " obj))", NIL);
if (!Getattr(n,"feature:immutable")) {
Printv(goopscode, " #:slot-set! ", primRenamer ? "primitive:" : "",
short_class_name, "-", proc, "-set", NIL);
Printv(goopscode, " #:slot-set! (lambda (obj value) (",
primRenamer ? "primitive:" : "",
short_class_name, "-", proc, "-set", " obj value))", NIL);
} else {
Printf(goopscode, " #:slot-set! (lambda (obj value) (error \"Immutable slot\"))");
}