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

Zack Lee cuinjune at gmail.com
Mon May 14 15:39:16 CEST 2018

Thank you so much for your explanation Christof.
I really hope to be able to type them in Pd one day.

Zack Lee

2018-05-14 20:43 GMT+09:00 Christof Ressi <christof.ressi at gmx.at>:

> it's because these characters are special in Tcl and Pd currently doesn't
> try to escape them when sending them to the gui. you can still construct
> those characters on the Pd side (e.g. sending the ascii value to [list
> tosymbol]) but you can't type them. I also find this very annoying (you
> can't type JS, Lua or most other code in Pd) but from what I understood
> those characters are kept reserved because one day they might be turned
> into a feature (e.g. using {} for nested lists).
> Gesendet: Montag, 14. Mai 2018 um 13:31 Uhr
> Von: "Zack Lee" <cuinjune at gmail.com>
> An: "Miller Puckette" <msp at ucsd.edu>, "PD List send" <pd-list at iem.at>
> Betreff: [PD] Reason for not allowing '{' and '}' in Pd?
> 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
>  _______________________________________________ Pd-list at lists.iem.at
> mailing list UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180514/663460ba/attachment-0001.html>

More information about the Pd-list mailing list