User Tools

Site Tools


4rpl:commands:call

Index

Function Call

Syntax

@FUNCTIONNAME

Description

Invokes a function named FUNCTIONNAME. Execution passes to said function and returns to the statement after the call when the function is complete. Arguments can be passed to and received from functions via the stack.

Examples

3 4 @MyMathFunction Trace  # will print 9 to the stack (3 * 4 - 3)
 
:MyMathFunction
   ->b ->a         # read 2 items from the stack
   <-a <-b * <-a - # multiply both and subtract the first
4rpl/commands/call.txt · Last modified: 2021/01/15 08:34 by Sanian