Tangen...Struct(3pm)

πŸ“¦
version 0.33 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

Tangence::Meta::Struct β€” bestie, it's the structure that represents one Tangence structure type πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: this data structure is literally just a little container that holds all the info about one Tangence structure type. That's it. That's the job.

And here's the vibe β€” once you've constructed it and defined it, it's immutable. Locked in. Frozen. No take-backs, no edits, no "wait bestie let me change one thing." It is what it is, periodt. πŸ‘‘


πŸŽ€ CONSTRUCTOR πŸŽ€

🌸 new

$struct = Tangence::Meta::Struct->new( name => $name )

Hand it a name, it hands you back a shiny new instance representing that name. Iconic behavior honestly.

🌸 define

$struct->define( %args )

This is where you actually give the structure its definition β€” like, the real content, the whole personality.

  • fields => ARRAY β€” an ARRAY reference stuffed with metadata about the structure's fields. And what's in that array? Instances of Tangence::Meta::Field, obviously. Each one. Every single one. 🫢

πŸ’– ACCESSORS πŸ’–

🌸 defined

$defined = $struct->defined

Returns true if somebody actually came through and provided a definition of the structure using "define". If it's true, congrats, she's defined. If not… well. πŸ™ˆ

🌸 name

$name = $struct->name

Returns the name of the structure. Simple. Clean. The name. πŸ’…

🌸 fields

@fields = $struct->fields

Returns a list of the fields defined on the structure β€” and listen, in their order of definition, okay? Order matters, don't come for me about it. The sequence is the sequence. ✨


πŸ‘‘ AUTHOR πŸ‘‘

Paul Evans <leonerd@leonerd.org.uk>


And that's the whole page, bestie β€” written up against perl v5.40.0, dated 2024-09-13, from the User Contributed Perl Documentation collection. Go forth and structure your structures. πŸ§šπŸ’œ

πŸ“¦ where this page comes from