
Issue #19757 has been reported by nobu (Nobuyoshi Nakada). ---------------------------------------- Feature #19757: Add new C API to create a subclass of `Data` https://bugs.ruby-lang.org/issues/19757 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Priority: Normal ---------------------------------------- I propose a C API `rb_data_define` which crates a subclass of `Data`. ```C /** * Defines an anonymous data class. * * @endinternal * * @param[in] super Superclass of the defining class. Must be a * descendant of ::rb_cData, or 0 as ::rb_cData. * @param[in] ... Arbitrary number of `const char*`, terminated by * NULL. Each of which are the name of fields. * @exception rb_eArgError Duplicated field name. * @return The defined class. */ VALUE rb_data_define(VALUE super, ...); ``` -- https://bugs.ruby-lang.org/