.. Functions can also have keyword parameters and arguments. The syntax of a keyword parameter/argument is [~|?]<id> [= <expression>], where the keyword name <id> is preceeded by the character ~ (for required arguments), or ? (for optional arguments). If a default value = <expression> is provided, the argument is always optional.
-Functions can also have keyword parameters and arguments. The syntax of a keyword parameter/argument is [~|?]<id> [= <expression>], where the keyword name <id> is preceeded by the character ~ (for required arguments), or ? (for optional arguments). If a default value = <expression> is provided, the argument is always optional.
+関数はまたキーワードパラメータと引数をもつことができます。構文は ``[~|?]<id> [= <expression>]`` であり、キーワード名 ``<id>`` は必須となる引数である場合 ``~`` から始まる文字列で指定し、オプションとなる引数の場合 ``?`` から始まる文字列で指定します。
.. Keyword arguments and normal anonymous arguments are completely separate. Also, it is an error to pass a keyword argument to a function that does not define it as a keyword parameter.
-Keyword arguments and normal anonymous arguments are completely separate. Also, it is an error to pass a keyword argument to a function that does not define it as a keyword parameter. ::
+キーワード引数と通常の匿名引数は完全に分離されます。また、キーワードパラメータを定義していない関数にキーワード引数を渡した場合、OMakeはエラーを送出します。 ::
osh>f(x, ?y = 1, z) =
add($(mul $x, 100), $(mul $y, 10), $z)
.. An optional keyword argument defaults to the empty value.
-An optional keyword argument defaults to the empty value. ::
+オプションとなるキーワード引数の値はデフォルトで空となります。 ::
osh> g(?x) =
println($">>>$x<<<")
.. It is an error to omit a required keyword argument.
-It is an error to omit a required keyword argument. ::
+必須となるキーワード引数を指定しない場合はエラーとなります。 ::
osh> h(~x, ~y) =
println(x = $x; y = $y)
.. Functions that are marked with the classifier curry can be called with “too many” arguments. It is expected that a curried function returns a function that consumes the remaining arguments. All arguments must be specified.
-Functions that are marked with the classifier curry can be called with “too many” arguments. It is expected that a curried function returns a function that consumes the remaining arguments. All arguments must be specified. ::
+分類辞 ``curry`` を付与した関数は『通常よりも多い』引数で呼び出すことができます。カリー化関数は、残りの引数をとる関数を返す必要があります。また、残りの引数を含めたすべての引数は指定しなければなりません。 ::
osh>curry.f(x, y) =
println($"Got two arguments: x = $x, y = $y")
.. The function apply can be used to compute partial applications, whether or not the function is labeled as a curried function.
-The function apply can be used to compute partial applications, whether or not the function is labeled as a curried function. ::
+また、関数はカリー化関数であるかどうかに関わらず、一部分のみを引数として渡すことができます。 ::
osh> f1(a, ~b = 2, ~c = 3, d) =
println($"a = $a, b = $b, c = $c, d = $d")