[PD-dev] namespaces for send/receive

Luke Iannini lukexipd at gmail.com
Tue Nov 17 03:18:40 CET 2009


2009/11/16  <zmoelnig at iem.at>:
> Quoting "Hans-Christoph Steiner" <hans at at.or.at>:
>
>>
>> I am in the process of working on my 'framesync' library, and I just  had
>> a thought that I am not sure has come up before.  Lots of times,  we want to
>> use send/receives in reusable code, but with a global  namespace, there is
>> the potential for nameclashes.  So I propose that  for libraries, we make it
>> a 'best practice' to use the same namespace  prefix as you would for loading
>> an object.
>>
>> For example, this 'framesync' library, I need to send the FPS (Frames  Per
>> Second) to all the objects, so it needs to be a global send.  So  just like
>> I could do [framesync/fstabplay~]  the internal send/receive  would be [send
>> framesync/fps] and [receive framesync/fps].
>
> while you are there, i would propose to use "/foo/bar" rather than
> "foo/bar".
>
> while this doesn't fully match the [foo/bar] idiom for object-names, it does
> fit nicely into OSC.

(okay, time-warping self-nullifying emailing at its best - see ending
parenthetical for my most up-to-date thinking on this matter.  I think
I agree with IO after all).

Just a quick comment... when I was writing and pondering the (still
very small) Pd Style Guide I decided it wasn't a good idea to use "/"
in send/receive namespaces.

The reason being, I didn't see a point in making s/r addresses look
like OSC addresses if they /weren't/ always OSC addresses, and that it
would be better to be explicit about how OSC fits into the picture in
cases where it actually does.

I used "-", like [s framesync-fps] (which matched well with what
miller and the majority of Pd users do habitually anyway (albeit with
no discernible formality in most cases).

Anyway, it's not meant as an attempt to bikeshed, just wanted to mention it : ).

(Ah, and just as I was about to hit send, I think I finally get the
idea of doing this: it's so one could receive incoming OSC messages
like [/framesync/fps 5( and then use a dynamic [send] to dispatch them
to the right [recieve]s!  I was stuck thinking you'd need a bunch of
[routeOSC]s everywhere which, in my previous experience, slowed my
patches to a crawl.).

Best
Luke

>
> mfgasdr
> IOhannes
>
>
>
> gfamnsdr
> IOhannes
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> Pd-dev mailing list
> Pd-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev
>
>




More information about the Pd-dev mailing list