[PD-dev] broken msgs cause Tcl traces, how to debug it?

mescalinum at gmail.com mescalinum at gmail.com
Mon Jan 23 18:57:17 CET 2012


On Mon, Jan 23, 2012 at 6:41 AM, Mathieu Bouchard <matju at artengine.ca> wrote:
>>> If you remove the [info complete] bracket from pd_readsocket, there are
>>> these intermittent Tcl stacktraces causes by messages from 'pd' to 'pd-gui'
>>> that get split in the wrong spot.
>
>
> yes, [info complete] is a potential major slowdown because it may reparse
> code many times while the amount of code increases. It's a n² time order
> thing.

moreover, one should not trust [info complete] as an oracle knowing
exactly where a Tcl command ends and another begins. it just checks
for unbalanced brackets/quotes [1].

think about:  .x8763 configure -text blah \n -command {blah…}
[info complete ".x8763 configure -text blah"] would return 1,
resulting in the evaluation of "-command {blah…}" as a separate
command".

[1] http://www.tcl.tk/man/tcl/TclCmd/info.htm#M9



More information about the Pd-dev mailing list