-
Notifications
You must be signed in to change notification settings - Fork 0
Nested function calls
Julius Paffrath edited this page Apr 17, 2017
·
3 revisions
Have you ever asked yourself what the following snippet will produce?
function my(num)
assign num plus 1 to num
return num
end
print(my(my(0)))You are right! The output will be
jask ~> 2.0The interpreter first executes my(0). Because a value was pushed and not a variable, a new variable is locally created on the function heap. The heap will be transfered to the second my() call and furthermore to the print call where it is destroyed.
- Home
- Getting started
- Control flow
- Functions
- Passing by value
- List variables in jask
- Dictionary variables in jask
- Structs in jask
- Convert variables
- Internal Functions
- The access operator
- Callbacks in jask
- Modules
- Internal Modules
- The jask standard library jcore
- Using CMD arguments in jask
- Nested function calls
- Functions inside functions!
- Modules inside functions!
- Performance comparison of loops