tcl::randomseed(n)

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

🌸 tcl::randomseed(n) 🌸

okay bestie, welcome to the tcl::randomseed page, straight out of the Reflected/virtual channel support corner of the Tcl manual. it's a little one, but she's important πŸ’–


✨ NAME ✨

tcl::randomseed β€” literally just utilities for random channels. that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

package require Tcl 8.5 9

package require TclOO

package require tcl::randomseed ?1.1?

::tcl::randomseed

::tcl::combine seed1 seed2

no cap, that's the whole surface area. four little lines and she's done πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so the tcl::randomseed package hands you a few utility commands whose entire job is helping you seed tcl::chan::random channels. that's it. that's the mission. 🌈


πŸ’– API πŸ’–

  • ::tcl::randomseed β€” okay so this one returns a list of seed integers that are suitable to hand over as the seed argument for random channels. and where do those numbers come from, you ask? bestie they're derived from the process id, the current time, and the Tcl random number generator. three sources, one slay list ✨
  • ::tcl::combine seed1 seed2 β€” this one takes two seed lists and merges them into a single list by XORing them elementwise, modulo 256. and if the lists aren't the same length? the shorter one gets padded with 0s before the merging happens. iconic behavior, honestly 🫢

😭 BUGS, IDEAS, FEEDBACK 😭

real talk: this document, and the package it describes, will undoubtedly contain bugs and other problems. nobody's perfect, not even our queen.

please report those in the category virtchannel of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. and please ALSO report any ideas for enhancements you have for either the package and/or the documentation β€” we want them, fr fr πŸ₯Ί

when you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. that's the format, bestie, don't freestyle it πŸ’€

also, note further that attachments are strongly preferred over inlined patches. you 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. iykyk 🧚


🌟 KEYWORDS 🌟

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


πŸ“ CATEGORY πŸ“

Channels


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


okay that's the page!! thanks for coming to my TED talk πŸ’… this was tcllib, version 1.1, and the page is tcl::randomseed(n) β€” go seed something random and stay hydrated, bestie πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from