Skip to content

WIP: Port unpost

Jonathan Wilkes requested to merge port-unpost into master

This ports the [unpost] object from matju's desiredata project. This is helpful for testing as it can be used to reroute error messages to an outlet.

Made some changes to his interface:

  • switched the outlets so that the rightmost outlet gets data first. It's still a confusing interface because the left inlet can receive a sequence of messages (the console message split at newlines).
  • added "error" argument to only intercept error messages. (Internally added a sys_printhook_error callback for this.)
  • protecting the left outlet output so that a downstream [print] won't cause an infinite loop -> crash. While it's certainly confusing to use [print] on that outlet, now users can do it without causing a crash. Plus it's likely users will use a [print] there to test output in the midst of writing their patch.

Given these changes we should probably change the name to something other than "unpost." Unprint?

Merge request reports