English (United Kingdom) Hebrew

Function

A function in Mama is a method returning a value. Thus, creating and editing of functions is similar to that of methods, with the following differences:
  • Functions do not consume time, i.e they executed immediately, and return the final value upon the end of the function
  • Consequently, functions do not contain simultaneous instructions such as doTogether.
  • Likewise, inside a function you can call only another function, not a method
Essentially, editing functions means calculating values along the function executed lines - every line not being a control instruction will produce a result that would be used in the following lines. The last line must be the return instruction, in which the calculated value is returned to the caller.