SPVM::Native::Arg(3)

πŸ“¦ version 0.990125, in alpine 3.24

✨ NAME ✨

Okay so this is SPVM::Native::Arg β€” it's a page from the SPVM manual (SPVM::Native::Arg(3), and yes bestie, it's a perl-documented one, we love that for us). It's literally all about Information of Arguments πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

The Native::Arg class of SPVM has methods to manipulate information of arguments. That's it, that's the vibe β€” it's your little handle for poking at what an argument is πŸ‘‘


πŸ¦‹ USAGE πŸ¦‹

Here's the whole flow, no cap:

  my $runtime = Native->get_current_runtime;

  my $basic_type = $runtime->get_basic_type_by_name("Point");

  my $method = $basic_type->get_method_by_name("new");

  my $arg = $method->get_arg_by_index(0);

  my $arg_index = $arg->get_index;

Grab the runtime, grab a basic type by name, grab a method off it, grab arg number 0, then ask that arg for its index. Slay. ✨


πŸ’– INSTANCE METHODS πŸ’–

⭐ get_index

  method get_index : int ();

Returns the index of this argument. As in β€” which slot this arg sits in. Numbered vibes only πŸ”’

⭐ get_basic_type

  method get_basic_type : Native::BasicType ();

Return the basic type of this argument. (Yes, the original says "Return" not "Returns" β€” we respect the icon's choices 🫢)

⭐ get_type_dimension

  method get_type_dimension : int ();

Returns the type dimension of this argument. Dimension check: passed πŸ“

⭐ get_type_flag

  method get_type_flag : int ();

Returns the type flag of this argument. Flags are so main character 🚩

⭐ is_optional

  method is_optional : int ();

If this argument is an optional argument, returns 1, otherwise returns 0. Simple binary, we love a clear answer πŸ’€

⭐ get_default_value_byte

  method get_default_value_byte : byte ();

Returns the default value of the optional argument arg of the "byte" type.

⭐ get_default_value_short

  method get_default_value_short : short ();

Returns the default value of the optional argument arg of the "short" type.

⭐ get_default_value_int

  method get_default_value_int : int ();

Returns the default value of the optional argument arg of the "int" type.

⭐ get_default_value_long

  method get_default_value_long : long ();

Returns the default value of the optional argument arg of the "long" type.

⭐ get_default_value_float

  method get_default_value_float : float ();

Returns the default value of the optional argument arg of the "float" type.

⭐ get_default_value_double

  method get_default_value_double : double ();

Returns the default value of the optional argument arg of the "double" type.

⭐ get_default_value_object

  method get_default_value_object : object ();

Returns the default value of the optional argument arg of an object type. Object defaults, we stan 🧚

Bestie note: there's one getter per default-value flavour β€” byte, short, int, long, float, double, and object. Pick the one that matches your arg's type, iykyk πŸ”₯

🌈 SEE ALSO 🌈

  • Native::Method
  • Native::BasicType
  • Native::Runtime
  • Native

Go read those next, they're the friend group πŸ’œ


Copyright (c) 2023 Yuki Kimoto

MIT License


And that's the whole page, bestie β€” perl v5.42.2, dated 2026-02-03, filed under SPVM::Native::Arg(3). Go forth and inspect those args πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from