[flext] More on naming...

Jamie Bullock jamie at jamiebullock.com
Thu Apr 10 16:34:07 UTC 2014


Hi Thomas,

I'm not using any DSP stuff personally, but I see in some of the objects from the zexy library the hex naming convention is used. For example in [<~] we have:

	void setup_0x3c0x7e(void)
    {
  	lt_tilde_class = class_new(gensym("<~"), (t_newmethod)lt_tilde_new, 0,
			    sizeof(t_lt_tilde), 0, A_GIMME, 0);


etc...

This suggests to me that the setup_* idiom doesn't require a "tilde" in the function name for DSP objects.

FWIW, I find the fact that Pd requires such a coupling between the entry point to the external and the external class name a bit unsatisfactory.

Jamie


On 10 Apr 2014, at 17:08, Thomas Grill <gr at grrrr.org> wrote:

> Hi Jamie, many thanks for the recipe. Let's see if this can be integrated into the trunk in a more compact way.
> Just to make sure: Are you certain that the tilde setup function for DSP objects doesn't need to be specified?
> gr~~~
> 
> --
> Thomas Grill
> http://grrrr.org
> 
> 
> 
> Am 10.04.2014 um 18:04 schrieb Jamie Bullock <jamie at jamiebullock.com>:
> 
>> 
>> Hi Thomas,
>> 
>> Thanks...
>> 
>> Actually, it seems sufficient to add to flbase.h:
>> 
>> #if defined(FLEXT_USE_HEX_SETUP_NAME) && defined(FLEXT_SYS_PD)
>>     #define FLEXT_STPF_0(NAME) setup_##NAME
>>     #define FLEXT_STPF_1(NAME) setup_##NAME
>> #elif FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX
>> 	#define FLEXT_STPF_0(NAME) NAME##_setup
>> 	#define FLEXT_STPF_1(NAME) NAME##_tilde_setup
>> #else
>> #error Platform not supported
>> #endif
>> 
>> And then to do something like:     
>> 
>> 	typedef class ml_svm ml0x2dsvm;
>> 	FLEXT_NEW("ml-svm", ml0x2dsvm);
>> 
>> I guess you might consider this a bit ugly, but it works for my purposes.
>> 
>> Jamie    
>>     
>> 
>> 
>> On 10 Apr 2014, at 11:55, Thomas Grill <gr at grrrr.org> wrote:
>> 
>>> Hi Jamie,
>>> it’s exactly the same as with the dot. To my knowledge, only a-z0-9_ are considered as normal characters for Pd externals.
>>> It would be possible to extend flext - it would require a new set of #defines for the class setup. It’s kind of awkward, that’s why i have refrained from it so far in the flext main trunk. But one can certainly fork the flext source and extend it in that fashion.
>>> gr~~~
>>> 
>>> Am 10.04.2014 um 12:50 schrieb Jamie Bullock <jamie at jamiebullock.com>:
>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> We've decided to change our naming convention from ml.* to ml-* so we can build our library as either a Max/Pd "library" or individual objects.
>>>> 
>>>> This presents a new problem:
>>>> 
>>>> - everything works under Max
>>>> - under Pd, we can use ml-* if we compile as a library
>>>> - if we compile as individual objects then Pd throws an error of the form "load_object: Symbol "setup_ml0x2dsvm" not found"
>>>> 
>>>> I did some investigation and if I create a normal Pd external (not using Flext), I can rename the setup function to "setup_ml0x2dsvm" and it does indeed work.
>>>> 
>>>> So my question is: is there any way to achieve this trick with Flext?
>>>> 
>>>> Jamie
>>>> 
>>>> 
>>>> _______________________________________________
>>>> http://grrrr.org/ext/flext
>>>> 
>>>> flext mailing list
>>>> flext at grrrr.org
>>>> http://grrrr.org/cgi-bin/mailman/listinfo/flext
>>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://grrrr.org/pipermail/flext/attachments/20140410/38460658/attachment-0001.html>


More information about the flext mailing list