Comparisment

   - compare programming languages by example

32

Function call

Call functions with arguments, producing a result.

Created by sam

Add a new answer

Either add an answer for a new language or add an alternative solution.
A description is only necessary when the code is not suitably 'obvious' or to justify an alternative approach.

Haskell

f 'a'

Supply a value ''a'' to a function 'f'.

Created by: sam

Edit this answer

Edit the language, code and description simultaneously.

Haskell

((f 'a') 1)

Apply a function 'f' to a value ''a'' which returns some function which is subsequently then applied to a value '1'.

Created by: sam

Edit this answer

Edit the language, code and description simultaneously.

Haskell

f 'a' 1

Apply a function in turn to multiple values ''a'' and '1' taking advantage of currying and the precedence of function application.

Created by: sam

Edit this answer

Edit the language, code and description simultaneously.

Haskell

f ('a',1)

Apply a single tuple value '('a',1)' to a function 'f'.

Created by: sam

Edit this answer

Edit the language, code and description simultaneously.

Apply the unit value '()' to the function 'f'.

Created by: sam

Edit this answer

Edit the language, code and description simultaneously.

Python

f('a')

Supply a value 'a' to a function.

Created by: sam

Edit this answer

Edit the language, code and description simultaneously.

Python

f('a',1)

Supply the two values ''a'' and '1' to a function.

Created by: sam

Edit this answer

Edit the language, code and description simultaneously.