Call a function: Difference between revisions
→{{header|Arturo}}
Drkameleon (talk | contribs) |
|||
Line 375:
=={{header|Arturo}}==
<lang arturo>printHello: {
print "Hello World!"
}
sayHello:
print "Hello " + to + "!"
}
printAll:
loop args {
print &
Line 389:
}
getNumber: { 3 }
// Calling a function that requires no arguments
printHello ~
// Calling a function with a fixed number of arguments
Line 401:
// Using a function in statement context
if true { printHello ~ }
// Using a function in first-class context within an expression
if
// Obtaining the return value of a function:
num:
{{out}}
|