Updated 2017-04-27 18:04:15 by pooryorick

sneaky message passing is about finding out-of-band channels for passing data between components.

errorInfo  edit

PYK 2014-04-14: I added an object system to Functional imaging which uses $::errorInfo to bind methods to their instances. Perhaps this is a hideous thing to do, but in its first application, at least, it seems harmless enough.

PYK 2014-06-19: In do...until in Tcl, the tailcall variant needed to store the result and options from catch without polluting the caller's namespace, so used $::errorInfo and ::$errorCode for the purpose.

procedure rewriting  edit

Braintwisters and other pages illustrate the art of rewriting procedures as an alternate way of passing information into the procedure.

interp alias  edit

To maintain some state, an alias can be rewritten each time it is employed. Over on the closures page, _countMe uses this technique.

info coroutine  edit

AMG: The Wibble web server arranges things such that the [info coroutine] command returns the name of the channel used to communicate with the client.

PYK 2014-06-19: I had seen that in Wibble. Nifty!

AMG: This avoids a ton of argument passing, and yet it avoids the pitfalls of global variables. Since [info coroutine] is now bytecoded, it may even be faster than a global too. Of course, this is a specialized circumstance and not likely to be applicable to just any old program.

namespace ensemble configure -map  edit

Many object systems use the namespace ensemble map in their implementation, notably to pass the name of the command for the current object. Some small examples are Using namespace ensemble without a namespace and eos.

trace  edit

trace is the quintessential out-of-band tool in Tcl.