function LSpell:initialize(name, atoms)
self.outlets = 1
self.inlets = 1
return true
end
function LSpell:in_1_symbol(s)
pd.post("received :" .. s)
word = get_word_from_inlet()
cmd = "aspell -c " .. word
p = assert(io.popen(cmd))
result = p:read("*all")
end
I know there is no output yet but the code is bugging at the
get_word_from_inlet() function.
where did you define get_word_from_inlet? You should just be able to
use 's', as that's the symbol atom passed to the inlet method.
mmh sure, I just used that cause that was the part of code frank
mentionned and thought this was a kind of pd secure-interacting
functions.
When I do :
[symbol toto(
|
[lspell]
pd prints:
received :toto
error: lua: error in dispatcher:
[string "lspell.pd_luax"]:14: attempt to call global
'get_word_from_inlet' (a nil value)
I have no really idea of the way pdlua manage functions and everything.
Must I dig more into the pd_lua examples or is this only a lua problem I
can handle if searching universal lua docs?
This seems to be a Lua problem more than a pdlua problem - you use
get_word_from_inlet() but don't define it anywhere.
A pdlua manual is on my todo list, but for now the examples are the best
documentation.
I manage to get it work with this code: