#I've got some quite old code here that I'm trying to run in modern Gauche, its mostly happy but it does some funky things with clos / mop and one sticking point is that gauche is unhappy with modifing the class after creation: "class is not malleable".
Is there a way to set this malleable attribute for a class? Or should I rewrite this code to do things differently?
#Class's malleable status is introduced as a safety net; it's unsafe to modify class structure except the certain stage of initialization. If you hit it even though you don't do anything seemingly dangerous, it could be a bug. Could you give me some code I can investigate?
##Hm, Gauche "freezes" the critical structure of a class at the end of (initialize ((class <class>) initargs)) method. If your metaclass's initialize method calls (next-method) first then want to tweak class structure, yes, you'll hit the malleability issue. Can't you do your thing in compute-cpl or compute-slots methods?
#I'm really not too sure about this codebase, I really just started digging in it.
#As you say though it does seem like an unsafe way to do things
#Seems that the offending part is setting class name afterwards.
#Yep, I'm not really sure has any affect in the rest of the code or not yet so I thought I'd ask about the malleable flag first. I can explore further though and remove it if its not used.
#The safer way, for now, is to introduce a common metaclass, and define initialize method on it what modifies initargs before calling next-method. But I realized certainly that limits the option. Maybe an option to override class name by :name keyword argument for define-class macro would be nicer.
#No problems thanks for the advice. As an aside, been really enjoying using Gauche. Really nice scheme.