[PD] Reason for not allowing '{' and '}' in Pd?

Zack Lee cuinjune at gmail.com
Mon May 14 13:31:11 CEST 2018


Hi, I'm trying to add a Lua scripting feature for my external which will
allow users to write and run Lua scripts directly in pd as object arguments
similar to how [expr] object works.

But the problem is curly brackets are used for table literals (e.g. a = {1,
2, 3}) in Lua, so it is not possible to create tables using this method.
I could only use '{' and '}' by editing the patch with a text editor, then
reopening the patch in Pd.

I found this code inside canvas_key() function from "g_editor.c" file.

if (keynum == '\\' || keynum == '{' || keynum == '}')
    {
        post("keycode %d: dropped", (int)keynum);
        return;
    }

I would like to know why these 3 characters are not allowed in Pd.
Would there be any problem if we remove the above code from Pd?
Thanks!

Best regards,
Zack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180514/e45ca109/attachment.html>


More information about the Pd-list mailing list