Commits

Taku Miyakawa  committed fcb2c76 Merge

Merges a branch which closes the issue #531

  • Participants
  • Parent commits 0ce38d9, 3598fba

Comments (0)

Files changed (2)

File src/doc/language/core.rst

 
 Functions
 =========
-A :dfn:`function` is a value which is callable with a receiver and arguments, and returns a value.
+A :dfn:`function` is a value which abstracts a series of processing.
 
 Calling functions
 -----------------
-A function can be called by a symbol or called directly.
+A :dfn:`function call` is an operation to a function, which takes a receiver and arguments, does the series of processing,
+and returns a value as the result.
 
-.. _language-core-call-by-symbol:
-
-A function can be :dfn:`called by the symbol` of a variable
-which targets the function, using :token:`call expressions <call>`.
+:dfn:`Call a function` is a verb to denote a function call.
 
 The example below calls a function
 targetted by a variable named ``print_line``.
 
     stdout.print_line('Hello!' 'UTF-8')  # => Hello!
 
-When a function is called by a symbol,
-the function is acquired :ref:`dereferencing a variable <language-core-cru-variable>`
-of the owner with the specified symbol.
-The receiver and the arguments are passed to the function.
-
 When the owner is not explicitly prefixed,
 the current environment shall be used as the owner.
 For example, these two lines are equivalent.
     print_line('Hello!')       # => Hello!
     \env.print_line('Hello!')  # => Hello!
 
-A function can also be :dfn:`called directly` without dereferencing a variable.
-In a Kink program, a function can be called directly using ``call`` function.
-
-::
-
-    $print_line.call('Hello!') # => Hello!
-
 A function returns a value as a :dfn:`result` if it completes its work without throwing an exception.
 In the next program, ``head`` function returns a string of the first two characters of "Hello!."
 

File src/doc/language/syntax.rst

     If there is, the part from the opening brace ``{`` to the closing brace ``}`` are
     regarded as an independent :ref:`function expression <language-syntax-fun>`.
 
-The runtime evaluates the owner, the actual receiver, and the actual arguments in the order they occured in the program,
-and :ref:`calls a function by the verb symbol <language-core-call-by-symbol>`.
+The runtime evaluates the owner, the actual receiver, and the actual arguments in the order they occured in the program.
+Then it derefernces the function, and calls it.
 
 In the example below, the function targetted by the variable ``fun`` of the value targetted by the variable ``Owner``
 is called twice.