-#define IMPLEMENT_BASE_SMOBS(CL) \
-scm_t_bits CL::smob_tag_; \
-SCM \
-CL::smob_p (SCM s) \
-{ \
- if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \
- return SCM_BOOL_T; \
- else \
- return SCM_BOOL_F; \
- \
-} \
- \
-void \
-CL::init_smobs () \
-{ \
- smob_tag_ = scm_make_smob_type (#CL, 0); \
- scm_set_smob_mark (smob_tag_, CL::mark_smob); \
- scm_set_smob_free (smob_tag_, CL::free_smob); \
- scm_set_smob_print (smob_tag_, CL::print_smob); \
- scm_set_smob_equalp (smob_tag_, CL::equal_p); \
-} \
- \
-size_t \
-CL::free_smob (SCM ses) \
-{ \
- CL *s = (CL*) SCM_CELL_WORD_1 (ses); \
- delete s; \
- scm_gc_unregister_collectable_memory (s, sizeof (CL), #CL " smob"); \
- return SMOB_FREE_RETURN_VAL(CL); \
-} \
- \
-ADD_SCM_INIT_FUNC (CL, CL::init_smobs)
+#define IMPLEMENT_BASE_SMOBS(CL) \
+ void \
+ CL ## _type_adder () \
+ {\
+ ly_add_type_predicate ((void*) &CL::unsmob, #CL); \
+ }\
+ ADD_SCM_INIT_FUNC(CL ## _type_adder_ctor, \
+ CL ## _type_adder);\
+ const char *CL::smob_name_ = #CL; \
+ scm_t_bits CL::smob_tag_; \
+ SCM \
+ CL::smob_p (SCM s) \
+ { \
+ if (SCM_NIMP (s) && SCM_CELL_TYPE (s) == smob_tag_) \
+ return SCM_BOOL_T; \
+ else \
+ return SCM_BOOL_F; \
+ \
+ } \
+ \
+ void \
+ CL::init_smobs () \
+ { \
+ smob_tag_ = scm_make_smob_type (#CL, 0); \
+ scm_set_smob_mark (smob_tag_, CL::mark_smob); \
+ scm_set_smob_free (smob_tag_, CL::free_smob); \
+ scm_set_smob_print (smob_tag_, CL::print_smob); \
+ scm_set_smob_equalp (smob_tag_, CL::equal_p); \
+ } \
+ \
+ size_t \
+ CL::free_smob (SCM ses) \
+ { \
+ CL *s = (CL *) SCM_CELL_WORD_1 (ses); \
+ delete s; \
+ /* scm_gc_unregister_collectable_memory (s, sizeof (CL), #CL " smob"); */ \
+ return SMOB_FREE_RETURN_VAL (CL); \
+ } \
+ \
+ ADD_SCM_INIT_FUNC (CL, CL::init_smobs)