Version 7 of sneaky message passing

Updated 2016-09-16 07:00:27 by pooryorick

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

errorInfo

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

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

interp alias

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]

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.


data between components.

errorInfo

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

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

interp alias

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

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.