-
Couldn't load subscription status.
- Fork 2
Functions
In Pikt, functions are essentially variables, with a block as their value, which starts with lambda.open 
lambda.close 
This is what an empty function looks like:
Now let's make the function print 
funcall 
The output is ABC as expected.
Every pixel between lambda.open 
Let's try editing the previous function so that the printed value comes from an argument 
Now let's call the function with "ABC" as a parameter.
Keep in mind that each parameter is a single pixel, therefore we must store "ABC" into a temporary variable 
Functions can return values. To do so, use a return 
Pseudocode:
function func() {
var value = "ABC"
return value
}
print(func())Pikt:
A return statement can also come without any value if the function does not expect an output value.




