tcl::chan::string(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ 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 (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