From fd1ab47a7f1b5f931395de34ec95512c20e7bdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Gr=C3=A4f?= Date: Sat, 14 Jan 2023 00:43:22 +0100 Subject: [PATCH] Fix the idiosyncratic "no atoms??" error message. 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 lovely quirks which I actually discuss in the tutorial in order to illustrate what happens if something goes wrong deep down in pdlua's internals. --- pd.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pd.lua b/pd.lua index 0be6e32..cf31d16 100644 --- a/pd.lua +++ b/pd.lua @@ -324,6 +324,9 @@ function pd.Class:dispatch(inlet, sel, atoms) end function pd.Class:outlet(outlet, sel, atoms) + if type(atoms) ~= "table" then + atoms = {atoms} + end pd._outlet(self._object, outlet, sel, atoms) end