Rosetta Code
Call a function
Demonstrate direct function calls with positional arguments and composed results.
Source
rosettacode/popular/call_a_function.vibe
# title: Call a function
# source: https://rosettacode.org/wiki/Call_a_function
# category: Rosetta Code
# difficulty: Intro
# summary: Demonstrate direct function calls with positional arguments and composed results.
# tags: popular, basics, functions, strings
# vibe: 0.2
def greet(name)
"hello, " + name
end
def emphasize(text)
text.upcase + "!"
end
def run
greeting = greet("vibescript")
{
greeting: greeting,
excited: emphasize(greeting),
combined: greet("rosetta code") + " / " + greet("browser runner")
}
end
Output
Press run to execute run from this example.