tcl::chan::random(n)

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

✨ tcl::chan::random β€” bestie edition ✨

okay so real quick, the manual name for this one is Reflected/virtual channel support, and it's a tcl::chan::random(n) page πŸ’– it lives in tcllib and it's all about making a channel that just... generates random characters forever. iconic behavior honestly.


🌈 NAME 🌈

tcl::chan::random β€” Random channel 🎲✨


πŸ¦‹ 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

πŸ’… DESCRIPTION πŸ’…

The tcl::chan::random package hands you a command that creates random channels β€” meaning read-only channels that, upon reading, return an infinite stream of pseudo-random characters. no cap, infinite. it just keeps going πŸŒ€

This is giving very similar energy to the random channels you'd get from the package Memchan, except:

  • this one is written in pure Tcl, not C 🫢
  • it uses a much simpler generator as well πŸ™ˆ
  • but flip side: Memchan works with Tcl 8.4 and before, whereas this package requires Tcl 8.5 or higher, and TclOO πŸ’€ (no TclOO, no vibes)

The internal TclOO class that implements the channel handler is a sub-class of the tcl::chan::events framework. it's giving family tree 🧚


πŸ‘‘ API πŸ‘‘

  • ::tcl::chan::random seed β€” this command creates a new random channel and returns its handle. the seed is a list of integer numbers used to initialize the internal feedback shift register of the generator. yes bestie, a whole feedback shift register, it's that serious πŸ’œ

πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. like, obviously. please report those in the category virtchannel of the Tcllib Trackers: [http://core.tcl.tk/tcllib/reportlist]. also please report any ideas for enhancements you may have for either the package and/or the documentation β€” we wanna hear it 🫢

When proposing code changes, please provide unified diffs, i.e. the output of diff -u. that's the format, bestie, respect it ✨

Note further that attachments are strongly preferred over inlined patches. attachments can be made 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. iykyk πŸ‘‘


πŸ”₯ KEYWORDS πŸ”₯

/dev/random, random, reflected channel, tip 219, virtual channel


πŸŽ€ CATEGORY πŸŽ€

Channels


Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>


okay that's the whole page, periodt 🌸 this was tcllib version 1.1 of the tcl::chan::random(n) man page β€” go make some infinite random characters, you've got this πŸ¦‹βœ¨

πŸ“¦ where this page comes from