Pure-data: Abstractions named "anything"

Created on 31 May 2018  路  9Comments  路  Source: pure-data/pure-data

If you try creating an abstraction named "anything" it will not be instantiated. Also after trying to create an [anything] PD won't instantiate other valid abstractions!

It seems that after the failed [anything] PD will instantiate previously used abstractions but will not instantiate others.

edit: I could not find the reason in the source code so i don't know if this happens by design. If its not by design then it's a bug. If it is by design there should be some kind of file documenting that reserved name.

Most helpful comment

that is actually a pretty funny bug! here's what's going on:

when you type something in an object box you're actually sending a message to pd_objectmaker with the selector being bound to a "new method" (for externals) or "do_create_abstraction" (for abstractions).
generally, if a message can't be found in a class (for pd_objectmaker this means object/abstraction hasn't been loaded yet), pd_typedmess falls back to the anything method - in the case of pd_objectmaker that's "new_anything" (see m_class.pd), which is responsible for loading unknown objects.
now when you do [anything ...], you basically override pd_objectmaker's anything method, preventing it from loading any new abstractions/externals.

for why the [anything] abstraction itself doesn't load, I'm not quite sure yet...

anyway, the fix is easy: add a check in "new_anything" that s != &s_anything.
I'll put it my list and make a PR.

EDIT: so until this gets fixed I have yet another great way how to prank my colleagues :-D

All 9 comments

seems you cannot have a compiled object called anything as well...

screen shot 2018-05-31 at 13 00 37

Anything is a Pd type name for, well, "anything." Consequently, I believe, you cannot use it as an abstraction or library name. It's the "a" in [trigger a]...

that is actually a pretty funny bug! here's what's going on:

when you type something in an object box you're actually sending a message to pd_objectmaker with the selector being bound to a "new method" (for externals) or "do_create_abstraction" (for abstractions).
generally, if a message can't be found in a class (for pd_objectmaker this means object/abstraction hasn't been loaded yet), pd_typedmess falls back to the anything method - in the case of pd_objectmaker that's "new_anything" (see m_class.pd), which is responsible for loading unknown objects.
now when you do [anything ...], you basically override pd_objectmaker's anything method, preventing it from loading any new abstractions/externals.

for why the [anything] abstraction itself doesn't load, I'm not quite sure yet...

anyway, the fix is easy: add a check in "new_anything" that s != &s_anything.
I'll put it my list and make a PR.

EDIT: so until this gets fixed I have yet another great way how to prank my colleagues :-D

awesome, cause now I wanna make an object called [anything] :)

can be closed

okay

have you tested this? cause I still can't create an abstraction called anything, or is this not in 0.48-2? just in the next release?

cause I still can't create an abstraction called anything

yes, but don't you get a warning: "object name anything not allowed"? creating such an object breaks Pd by design, so we explicitly disallow it.

oh... i didn't realize the idea was that you now can;t do it, haha

Was this page helpful?
0 / 5 - 0 ratings