#53 class loader for non alpha-numeric classnames


object-names containing non-alphanumerics like [||~]
can (sometimes) be not represented on filesystems (e.g.
"|" is a forbidden character) and more often they
cannot be used to construct a valid setup-function
("||~_setup" or "||_tilde_setup" are really bad).
the way the "~" is handled, is non-generic and thus

as a solution me and hcs proposed an encoding into
alphanumeric-values, using a hexadecimal representation
of all characters but [0-9A-Za-z_] (e.g. "+" is ascii
43 and is thus represented by "0x2b" (hex-value all
lowercase and prepended with "0x")

e.g. if we have a new class "mtx_||", pd first attempts
to find a file called "mtx_||.dll". if it succeeds, it
will try to call the "mtx_||_setup()" function.
if that fails we suggest to try and call a function
"setup_mtx_0x7c0x7c()" (the keyword setup is now at the
beginning of the function-name, in order to prevent the
names starting with numbers and in order to distinguish
between the normal setup-methods).
if no "mtx_||.dll" can be found, pd should then search
for a file "mtx_0x7c0x7c.dll" (guaranteed to be
representable on any filesystem); search this file for
the 2 setup-functions.
if all fails try to find "mtx_||.pd" and then


  • Logged In: YES

    attached is a patch against s_loader.c, s_class.c and
    m_stuff.h that achieves this functionality

  • patch against pd-0.39-1 (full hex-encoding functionality)

  • Logged In: YES

    It's ugly, but I think it's really needed anyway. It would
    also be good someday to fix abstractions to do this too.
    Anyway, I took it for upcoming version 0.40

    • status: open --> closed-accepted


Cancel   Add attachments