There exists also another way, that is based on stored procedures. If one look e.g.:
https://openacs.org/api-doc/proc-view?proc=::xo::db::sql::acs_object_type+proc+create_type&source_p=1
This is another tcl way to build a new acs_object type.
This kind of procs in the ::xo::db::sql namespace are automatically created at startup for every proc defined in the acs_function_args table. One way to see how this machinery works is grepping in the sql code for:
define_function_args
Hope this helps
Antonio