Product Site

5.1.4.20. send

Returns the result of invoking a method on the target object using the specified message name and arguments. The send method allows methods to be invoked using dynamically constructed method names.

The messagename can be a string or an array. If messagename is an array object, its first item is the name of the message and its second item is a class object to use as the starting point for the method search.

Any arguments are passed to the receiver as arguments for messagename in the order you specify them.
Example 5.35. Object class — send method
world = .WorldObject~new
-- these calls are equivalent and produce "Hello World, I'm Fred!"
say world~hello("World", "Fred")
say world~send("HELLO", "World", "Fred")

::class WorldObject
::method hello
  use strict arg place, name
  return "Hello" place", I'm"  name"!"