tcl::c...:random(3tcl)
β¨ tcl::chan::random β the random channel era β¨
okay so bestie, this is the page for tcl::chan::random, and it lives in the 3tcl manual section of Tcllib. it's giving pure Tcl chaos generator and honestly? iconic. let's get into it π
πΈ NAME πΈ
tcl::chan::random β Random channel. that's it, that's the whole vibe. a channel that's just... random. no cap.
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require TclOO
package require tcl::chan::events ?1.1?
package require tcl::chan::random ?1.1?
::tcl::chan::random seed
like, you do need Tcl 8.5 or 9, and you do need TclOO. no skipping steps bestie π
π DESCRIPTION π
so the tcl::chan::random package hands you a command that creates random channels. what's a random channel, you ask? it's a read-only channel that, when you read from it, just keeps giving you an infinite stream of pseudo-random characters. infinite!! it never runs out. main character energy fr fr π
this is lowkey similar to the random channels that the package Memchan provides β except (and this is the tea β):
- this one is written in pure Tcl, not C
- it also uses a much simpler generator
on the other hand, Memchan is usable with Tcl 8.4 and before, whereas this package requires Tcl 8.5 or higher, plus TclOO. so like, pick your fighter based on your Tcl version, iykyk π¦
also, the internal TclOO class that implements the channel handler is a sub-class of the tcl::chan::events framework. cute little family tree, obsessed π
π«Ά API π«Ά
::tcl::chan::random seedβ this command creates a brand new random channel and returns its handle (yes, you need that handle, don't lose it bestie π). theseedis a list of integer numbers that gets used to initialize the internal feedback shift register of the generator. so that's where the randomness starts, periodt β¨
π BUGS, IDEAS, FEEDBACK π
ngl, this document β and the package it describes β will undoubtedly contain bugs and other problems. it's not a flaw, it's a lifestyle π
please report them in the category virtchannel of the Tcllib Trackers:
http://core.tcl.tk/tcllib/reportlist
and please also report 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
also note: attachments are strongly preferred over inlined patches. you can make an attachment 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. that's the one. the left-most one. slay π
π₯ KEYWORDS π₯
/dev/random, random, reflected channel, tip 219, virtual channel
π CATEGORY π
Channels
πΈ COPYRIGHT πΈ
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
ok that's the whole page bestie, you're officially a random channel expert πβ¨
this was the tcl::chan::random page from Tcllib 1.1 in the 3tcl manual β mwah, go read something else now, ily π«Άππ¦
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- 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