Call a function: Difference between revisions

Content added Content deleted
m (Update Lang example: Fix spelling of Lang)
Line 3,551: Line 3,551:




# In lang there are text and array varags parameters
# In Lang there are text and array varags parameters
fp.varArgsText = ($text...) -> \!
fp.varArgsText = ($text...) -> \!
fp.varArgsText(1) # Var args text will be called with "1"
fp.varArgsText(1) # Var args text will be called with "1"
Line 3,589: Line 3,589:
$ret = fp.inc2(40) # $ret is 42
$ret = fp.inc2(40) # $ret is 42


# Built-in (They are called predefined functions in lang) start with the "func." or "fn." prefix wheras user-defined functions start with "fp."
# Built-in (They are called predefined functions in Lang) start with the "func." or "fn." prefix wheras user-defined functions start with "fp."
# Linker functions start with "linker." or "ln."
# Linker functions start with "linker." or "ln."
# Predefined and linker functions can be stored in a user-defined function
# Predefined and linker functions can be stored in a user-defined function
Line 3,595: Line 3,595:
fp.userDefinedFunc(Called println)
fp.userDefinedFunc(Called println)


# In lang there are no subroutines
# In Lang there are no subroutines


# In lang functions can have call-by-pointer values
# In Lang functions can have call-by-pointer values
# $ptr is a pointer to the called value
# $ptr is a pointer to the called value
fp.callByPtr = ($[ptr]) -> \!
fp.callByPtr = ($[ptr]) -> \!