ExtUti...gument(3pm)

✨ NAME ✨

ExtUtils::XSpp::Node::Argument β€” the node that's literally just holding one single method-or-function argument (yes bestie, this is from the ExtUtils::XSpp family of manual pages, Perl section 3, and we're about to make it make sense πŸ’…)

🌸 DESCRIPTION 🌸

So picture this: ExtUtils::XSpp::Node::Argument is a subclass of ExtUtils::XSpp::Node, and it represents exactly one argument of a single function or method. Like, one. Not the whole signature, just the one lil guy. πŸŽ€

Take something like this:

int foo = 0.

That right there would translate into an ExtUtils::XSpp::Node::Argument where:

  • its type is set to int
  • its name is set to foo
  • its default is set to 0.

no cap, that's the whole vibe. it's giving "one argument, fully catalogued, main character energy" πŸ‘‘


πŸ¦‹ METHODS πŸ¦‹

πŸ’– new

Creates a brand new ExtUtils::XSpp::Node::Argument. Baby node, fresh out the box.

Named parameters are:

  • type β€” tells you the C++ argument type
  • name β€” tells you the variable name
  • default β€” and optionally, the default value of the argument

πŸ’– uses_length

Returns true if the argument uses the XS length feature, and false otherwise. Simple as. βœ…βŒ

πŸ’– implementation_name

Returns the exact same thing as the name method... unless the argument is of the %length(something) variant. πŸ™ˆ

And if it is that variant? Then implementation_name returns a munged version of the name β€” one that deals with the name mangling that xsubpp does β€” and that munged name is XSauto_length_of_somthing.

πŸ’– fix_name_in_code

You hand it a code string, and it replaces any occurrences of the name of this Argument with its implementation name. ✨

But here's the chill part: if the implementation name is the same as the name β€” which, honestly, is the most likely case β€” then the code stays completely untouched. Not a single character moved. 🫢

It returns the potentially modified code.


🌈 ACCESSORS 🌈

⭐ type

Returns the type of the argument.

⭐ name

Returns the variable name of the argument variable.

⭐ default

Returns the default for the function parameter, if there is one.

⭐ has_default

Returns whether there is a default for the function parameter. (the vibes check: default or no default πŸ’€)

⭐ function

Returns a reference to the containing function/method. iykyk, it's the parent vibes.

⭐ index

Returns the 0-based index of the argument in the argument list. Counting from zero because of course it does, it's Perl's ecosystem bestie πŸ“


lowkey iconic that you read the whole thing. go forth and wrangle those XS arguments πŸ‘‘

mwah πŸ’‹ this page ships with perl v5.40.1, and that footer date on the original was 2026-07-03 β€” so jot that down, bestie, it's the version-and-date tea for this one πŸŽ€βœ¨

πŸ“¦ where this page comes from