tcl::tr...:observe(n)
π NAME π
tcl::transform::observe β the observer transformation, aka stream copy, aka "I watch everything and keep receipts" π
(oh also hi bestie, this page lives in the Reflected/virtual channel support manual, section n, so if you were looking for it under that name β you found her π«Ά)
β¨ SYNOPSIS β¨
package require Tcl 8.6 9
package require tcl::transform::core ?1.1?
package require tcl::transform::observe ?1.1?
::tcl::transform::observe chan logw logr
π¦ DESCRIPTION π¦
Okay so the tcl::transform::observer package hands you a command that builds a channel transformation. What does it do? It passes the read and written bytes straight through, completely unchanged β literally like tcl::transform::identity does, no edits, no drama, the data comes out exactly how it went in. π
But here's the plot twist: on top of that, it also copies the data it has seen, for each direction, into channels you specify when you construct it. So it's the friend who's not changing the group chat, just quietly screenshotting everything into two other chats. π
The other transformations hanging out in this module, if you wanna meet the rest of the girlies, are tcl::transform::adler32, tcl::transform::counter, tcl::transform::crc32, and tcl::transform::identity. π
Also, nerd note for the girlies who care (and you should, iykyk): the internal TclOO class doing the actual transform handler work is a subclass of the tcl::transform::core framework. Iconic inheritance moment. π
π₯ API π₯
::tcl::transform::observe chan logw logrβ makes an observer transformation sitting on top of the channelchan, and returns its handle. The channel handleslograndlogware where the data gets copied to. π
π BUGS, IDEAS, FEEDBACK π
Real talk: this document, and the package it describes, will undoubtedly contain bugs and other problems. Not me being shady β that's literally what it says. π So if you find one, please report it in the category virtchannel of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist. And if you have ideas for enhancements for either the package and/or the documentation, send those too, bestie, we want them. π
When you're proposing code changes, please provide unified diffs, i.e. the output of diff -u.
Also, heads up: attachments are strongly preferred over inlined patches. To attach one, go to the Edit form of the ticket right after you create it, then use the left-most button in the secondary navigation bar. π«Ά
πΈ KEYWORDS πΈ
channel transformation, observer, reflected channel, stream copy, tip 230, transformation, virtual channel
π CATEGORY π
Channels
π COPYRIGHT π
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page, slay π
this was tcllib, version 1.1, of tcl::tr...:observe(n) β go be the main character of your own channel transformation π¦β¨
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms