tcl::chan::zero(n)

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

πŸ’– tcl::chan::zero(n) πŸ’–

Reflected/virtual channel support β€” yes bestie, we're in the Tcllib tcl::chan::zero(n) page, and it's lowkey iconic ✨


πŸŽ€ NAME πŸŽ€

tcl::chan::zero β€” Zero channel. That's it, that's the name, it's giving minimal and we respect it πŸ’…


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require TclOO

package require tcl::chan::events ?1.1?

package require tcl::chan::zero ?1.1?

::tcl::chan::zero

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so, the tcl::chan::zero package hands you a command that makes zero channels. And what is a zero channel, you ask? It's a read-only channel that, when you read from it, just gives you an infinite stream of null characters. Forever. Endless. No cap, it will never run out 🫢

It's basically the same deal as the zero channels that the package Memchan gives you β€” except this one is written in pure Tcl, not C. Which, slay, but also: the tradeoff is real. Memchan works with Tcl 8.4 and before, whereas this package needs Tcl 8.5 or higher, plus TclOO. So if you're on ancient Tcl, bestie, this one isn't gonna work out 😭

Packages related to this one: tcl::chan::null and tcl::chan::nullzero. Siblings! Family! We love a cohesive little ecosystem 🌸

And for the lore girlies: the internal TclOO class that implements the channel handler is a sub-class of the tcl::chan::events framework. It's giving inheritance, it's giving main character energy πŸ‘‘


🌈 API 🌈

  • ::tcl::chan::zero β€” this command creates a brand new zero channel and returns its handle. That's the whole vibe. Call it, get a handle, go read your infinite nulls πŸ’–

πŸ™ˆ BUGS, IDEAS, FEEDBACK πŸ™ˆ

This document, and the package it describes, will undoubtedly contain bugs and other problems.

Yes, they said it themselves, and honestly? Respect for the honesty. If you find something cursed, please report it in the category virtchannel of the Tcllib Trackers at [http://core.tcl.tk/tcllib/reportlist]. Ideas for enhancements β€” for either the package and/or the docs β€” are also extremely welcome, so don't be shy πŸ₯°

When you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. That's the format they want, fr fr.

Also important: attachments are strongly preferred over inlined patches. How do you attach? Go to the Edit form of the ticket immediately after its creation, and then use the left-most button in the secondary navigation bar. Boom, attached, you're a legend ⭐


πŸ”₯ KEYWORDS πŸ”₯

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


πŸ‘‘ CATEGORY πŸ‘‘

Channels


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


And that's the whole page, bestie! This little beauty is from tcllib, version 1.1, dated with the manpage tag tcl::chan::zero(n) β€” so go forth and read your infinite nulls responsibly πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from