agraef / pd-lua

Lua bindings for Pd, updated for Lua 5.3+
https://agraef.github.io/pd-lua/
GNU General Public License v2.0
47 stars 10 forks source link

Fix the idiosyncratic "no atoms??" error message. #27

Open agraef opened 1 year ago

agraef commented 1 year ago

This Lua error appears if the atoms argument to pd.Class:outlet is anything but a table. The fix is trivial: Check that the atoms argument actually is a table, and, if this is not the case, either output a more helpful error message, or just turn the singleton into a table with one element (which is what we do here).

I'm not sure that I actually want to fix this. It's one of pdlua's funny quirks which I actually discuss in the tutorial in order to illustrate what happens if something goes wrong deep down in pdlua's internals.

agraef commented 2 days ago

Well, "no atoms??" is no more, it has been replaced by much better error reporting. But the error could still be avoided by this changeset, so I'm keeping the PR for now.