Call a function: Difference between revisions

From Rosetta Code
Content added Content deleted
(Initial draft)
 
Line 15: Line 15:
Note this task is about methods of calling functions, not methods of [[Function definition|defining functions]], which is a separate topic.
Note this task is about methods of calling functions, not methods of [[Function definition|defining functions]], which is a separate topic.


[[Category:Functions]]
[[Category:Functions and subroutines]]

Revision as of 00:13, 15 July 2011

Call a function is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

The task is to demonstrate the different syntax and semantics that the language may provide for calling a function. This may include:

  • Calling a function that requires no arguments
  • Calling a function with a fixed number of arguments
  • Calling a function with a variable number of arguments (varargs)
  • Calling a function with named arguments
  • Using a function in command context
  • Using a function in first class context within an expression
  • Obtaining the return value of a function
  • Demonstrating any differences that apply to calling builtin functions rather than user defined functions
  • Demonstrating differences between calling subroutines and functions, if these are separate cases within the language.

Note this task is about methods of calling functions, not methods of defining functions, which is a separate topic.