find(n)

πŸ’– find(n) β€” the [incr Tcl] glow-up edition πŸ’–

okay bestie, welcome to find, a little command from the itcl world (that's [incr Tcl], the Tcl extension that gives you classes and objects, very demure, very c++-but-make-it-tcl) 🌸


✨ NAME ✨

itcl::find β€” go on a lil scavenger hunt for classes and objects πŸ”


πŸŽ€ SYNOPSIS πŸŽ€

itcl::find option ?arg arg ...?

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, the find command is your bestie when you need to locate classes and objects that are hanging out in the current interpreter. it's giving "where are my people at" energy πŸ’…

the way it reports things: classes and objects in the active namespace come first, and then everything in all the other namespaces in the interpreter. current faves first, then the rest of the group chat, periodt ✨

the option argument is what decides which action actually goes down. the legal options are below β€” and yes, they can be abbreviated (short queen energy, we love that) πŸ’–


πŸ‘‘ OPTIONS πŸ‘‘

find classes ?pattern? πŸ“š

returns a list of [incr Tcl] classes, no cap.

  • classes in the current namespace get listed first πŸ₯‡
  • then classes in all other namespaces in the interpreter follow

if you pass the optional pattern, the reported names get compared using the rules of the "string match" command, and only the matching names get reported. it's giving "filtered, curated, iconic" 🌈

now here's the naming tea β˜•: if a class lives in the current namespace context, this command reports its simple name β€” no qualifiers, just the bare name, natural, effortless πŸ’«

BUT 🚨 if the pattern contains :: qualifiers, or if the class lives in another context, this command reports its fully-qualified name instead. so if you want a list where every single name is fully-qualified, you can run this:

itcl::find classes ::*

slay. that's the one. 🫢


find objects ?pattern? ?-class className? ?-isa className? 🧸

returns a list of [incr Tcl] objects, and honestly? iconic.

  • objects in the current namespace are listed first πŸ₯‡
  • then objects in all other namespaces in the interpreter

if the optional pattern is specified, the reported names get compared using the rules of the "string match" command, and only matching names get reported. only the ones that pass the vibe check ✨

if the optional -class parameter is specified, the list gets restricted to objects whose most-specific class is className. that's the main character class right there πŸ‘‘

if the optional -isa parameter is specified, the list gets further restricted to objects that have the given className anywhere in their heritage. like, not just who they are β€” who their whole family tree is 🧬

and same naming rules as above, bestie: if an object lives in the current namespace context, this command reports its simple name β€” no qualifiers. but if the pattern contains :: qualifiers, or if the object lives in another context, you get the fully-qualified name instead. so for a fully-qualified everything list:

itcl::find objects ::*

obsessed. truly. πŸ’œ


πŸ”‘ KEYWORDS πŸ”‘

class, object, search, import


quick lil reminder bestie: classes and objects get reported first in the active namespace, then in all other namespaces β€” and if you need fully-qualified names everywhere, that ::* pattern is your girl. don't forget the :: qualifiers change how names get reported! πŸ’–

and that's the whole page, no notes πŸŽ€ this came out of itcl version 3.0 and it's the find(n) page β€” go forth and find your classes and objects, bestie, you've got this πŸ’…βœ¨πŸ¦‹πŸŒΈ