tcl::chan::string(n)
β¨ tcl::chan::string β the manual, but make it cute β¨
okay so bestie, welcome to tcl::chan::string(n), part of the Reflected/virtual channel support corner of tcllib. sit down, grab a boba, we're building channels that live entirely in your RAM π
πΈ NAME πΈ
tcl::chan::string β a read-only, in-memory channel. yeah. it's giving β¨immutableβ¨ and we're obsessed.
π SYNOPSIS π
package require Tcl 8.5 9
package require TclOO
package require tcl::chan::events ?1.1?
package require tcl::chan::string ?1.0.4?
::tcl::chan::string content
π¦ DESCRIPTION π¦
so the tcl::chan::string package hands you a command that makes channels which live purely in memory. no disk, no filesystem, no drama. they give you random-access, which is just the fancy way of saying they're seekable β you can jump around inside them however you want π₯
but here's the plot twist, bestie: unlike the channels that tcl::chan::memchan makes, these ones are read-only. the content gets handed over at construction time and then it is immutable afterward. periodt. no editing, no rewriting, no take-backs. what you get is what you get π
the related packages in this little friend group are tcl::chan::memchan and tcl::chan::variable β go say hi π«Ά
and the tea about the internals: the TclOO class doing all the actual channel-handler work is a sub-class of the tcl::chan::events framework. iykyk π
π API π
::tcl::chan::string contentβ this is the one and only command, and she's the main character fr fr. she creates a brand new string channel and hands you back its handle. that channel gives you random read-only access to the content string. that's it. that's the whole vibe β¨
π BUGS, IDEAS, FEEDBACK π
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's not a vibe, it's just reality π please report them in the virtchannel category of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist. and while you're there, please also drop any ideas for enhancements you may have for either the package and/or the documentation β we love a glow-up suggestion π
when you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. that's the format, bestie, don't fight it π
also note: attachments are strongly preferred over inlined patches. you can attach stuff by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. easy. slay π¦
π KEYWORDS π
in-memory channel, reflected channel, tip 219, virtual channel
β CATEGORY β
Channels
π COPYRIGHT π
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page, bestie, you ate that π this was tcllib, version 1.0.4, serving you tcl::chan::string(n) realness. go forth and make in-memory channels. no cap π
β¨
π¦ 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