random(3tcl)

πŸ“¦
version 2.3 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– random β€” bestie edition πŸ’–

okay so this is random(3tcl), from the memchan family of manual pages, and babes it's literally so fun. we're making a channel that spits out randomness. let's get into it πŸŽ€


✨ NAME ✨

random β€” create and manipulate randomizer channels 🌈


🌸 SYNOPSIS 🌸

package require Tcl

package require memchan

random

no cap, that's the whole vibe. you pull in Tcl, you pull in memchan, and then random shows up. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea, bestie. random creates a random channel β€” and the way this thing works is genuinely iconic:

  • everything you write into it gets absorbed 🫧
  • and that absorbed stuff gets used as a seed for a random number generator
  • then that generator is what makes a random sequence of bytes whenever you read from the channel

so like. you pour words in, you get chaos out. main character energy fr fr ✨

and one thing you gotta know up front:

it is not possible to seek the channel. don't even try it. that's not a thing here. periodt. πŸ’€

πŸŽ€ OPTIONS πŸŽ€

Memory channels created by random provide one additional option to set or query. just one! a lil baby option. but it's important so pay attention bestie πŸ‘‘

  • -delay ?milliseconds? β€” okay so a random channel is always writable and readable. sounds great right?? but it means all fileevent-handlers will fire continuously 😭 to avoid starvation of other event sources, the events raised by this channel type have a configurable delay. this option is set in milliseconds and defaults to 5. so like, if you don't say anything, it's 5 ms. that's the vibe check. πŸ•

πŸ’œ SEE ALSO πŸ’œ

go read these too, they're all part of the squad 🫢

  • fifo
  • fifo2
  • memchan
  • null
  • zero

⭐ KEYWORDS ⭐

  • channel
  • i/o
  • in-memory channel
  • random

iykyk 😌


Copyright (c) 2004 Pat Thoyts <patthoyts@users.sourceforge.net>


and that's the whole page bestie!! this was Memory channels, version 2.2, and the page itself is random(3tcl) β€” originally dated with the memchan 2.2 release. thank you for coming to my ted talk, mwah πŸ’–πŸŒΈπŸ¦‹βœ¨πŸŽ€πŸ’…

πŸ“¦ where this page comes from