coroutine::auto(n)

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

✨ coroutine::auto β€” the manual page, but make it cute ✨

okay so this is coroutine::auto(n) β€” the (n) is just the Tcl manual section, bestie, it's not part of the command name πŸ’–


πŸ¦‹ NAME πŸ¦‹

coroutine::auto β€” automatic event and IO coroutine awareness. that's it, that's the whole name, slay ✨


🌸 SYNOPSIS 🌸

package require Tcl 8.6 9

package require coroutine::auto 1.3

package require coroutine 1.4

πŸ’… DESCRIPTION πŸ’…

okay so here's the tea, and it's genuinely iconic: the coroutine::auto package gives you no commands and no other directly visible functionality. like, zero. nothing to call. it's giving invisible bestie energy πŸ™ˆ

what it does do β€” and this is the main character moment β€” is it's built on top of the package coroutine, and it intercepts various builtin commands of the Tcl core to make any code using them coroutine-oblivious, i.e. able to run inside and outside of a coroutine without changes. no rewrites, no edits, no "wait which context am I in" panic. it just works. periodt πŸ‘‘


πŸŽ€ the commands it's got its eye on πŸŽ€

these are the builtins affected by this package, fr fr:

  • after
  • exit
  • gets
  • global
  • puts
  • read
  • socket
  • update
  • vwait

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

ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. 😭 that's just how it is.

please report such in the category coroutine of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist

please also report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas. ideas are the vibe 🫢

when proposing code changes, please provide unified diffs, i.e the output of diff -u.

also note, bestie: 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. yes, that exact one. the left-most one. iykyk ✨


πŸ”₯ KEYWORDS πŸ”₯

after, channel, coroutine, events, exit, gets, global, green threads, read, threads, update, vwait


🌈 CATEGORY 🌈

Coroutine


Copyright (c) 2010-2014 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page, no cap πŸ’œ this was brought to you by tcllib, version 1.3 β€” thanks for coming to my ted talk, mwah πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from