@@ -3340,10 +3340,10 @@ msgstr ""
33403340
33413341#. type: Plain text
33423342#: doc/tutorial.md:1434
3343- msgid "~~~~ fn call_closure_with_ten(b: &fn( int) ) { b(10); }"
3343+ msgid "~~~~ fn call_closure_with_ten(b: | int| ) { b(10); }"
33443344msgstr ""
33453345"~~~~\n"
3346- "fn call_closure_with_ten(b: &fn( int) ) { b(10); }"
3346+ "fn call_closure_with_ten(b: | int| ) { b(10); }"
33473347
33483348#. type: Plain text
33493349#: doc/tutorial.md:1437
@@ -3400,11 +3400,11 @@ msgstr ""
34003400#: doc/tutorial.md:1459
34013401msgid ""
34023402"There are several forms of closure, each with its own role. The most common, "
3403- "called a _stack closure_, has type `&fn ` and can directly access local "
3403+ "called a _stack closure_, has type `|| ` and can directly access local "
34043404"variables in the enclosing scope."
34053405msgstr ""
34063406"クロージャにはいくつかの形態があり、それぞれに独自の役割があります。最も一般"
3407- "的なのはスタッククロージャと呼ばれるもので、 `&fn ` という型を持ち、外側のロー"
3407+ "的なのはスタッククロージャと呼ばれるもので、 `|| ` という型を持ち、外側のロー"
34083408"カル変数に直接アクセスすることができます。"
34093409
34103410#. type: Plain text
@@ -3531,27 +3531,27 @@ msgstr "## クロージャの互換性"
35313531msgid ""
35323532"Rust closures have a convenient subtyping property: you can pass any kind of "
35333533"closure (as long as the arguments and return types match) to functions that "
3534- "expect a `&fn() `. Thus, when writing a higher-order function that only calls "
3534+ "expect a `|| `. Thus, when writing a higher-order function that only calls "
35353535"its function argument, and does nothing else with it, you should almost "
3536- "always declare the type of that argument as `&fn() `. That way, callers may "
3536+ "always declare the type of that argument as `|| `. That way, callers may "
35373537"pass any kind of closure."
35383538msgstr ""
35393539"Rust のクロージャは型の派生 (subtyping) という便利な性質を持っています。この"
3540- "性質により、`&fn() ` 型を期待する関数には (引数と戻り値の型が一致する限り) 任"
3540+ "性質により、`|| ` 型を期待する関数には (引数と戻り値の型が一致する限り) 任"
35413541"意の種類のクロージャを渡すことができます。したがって、引数で渡された関数につ"
35423542"いては呼び出すだけで他に何もしない高階関数を書くときには、ほぼすべてのケース"
3543- "で引数の型を `&fn ` と宣言するべきです。そうすることで、呼び出し元は任意の種類"
3543+ "で引数の型を `|| ` と宣言するべきです。そうすることで、呼び出し元は任意の種類"
35443544"のクロージャを渡すことができるよになります。"
35453545
35463546#. type: Plain text
35473547#: doc/tutorial.md:1527
35483548msgid ""
3549- "~~~~ fn call_twice(f: &fn() ) { f(); f(); } let closure = || { \" I'm a "
3549+ "~~~~ fn call_twice(f: || ) { f(); f(); } let closure = || { \" I'm a "
35503550"closure, and it doesn't matter what type I am\" ; }; fn function() { \" I'm a "
35513551"normal function\" ; } call_twice(closure); call_twice(function); ~~~~"
35523552msgstr ""
35533553"~~~~\n"
3554- "fn call_twice(f: &fn() ) { f(); f(); }\n"
3554+ "fn call_twice(f: || ) { f(); f(); }\n"
35553555"let closure = || { \" I'm a closure, and it doesn't matter what type I am"
35563556"\" ; };\n"
35573557"fn function() { \" I'm a normal function\" ; }\n"
@@ -3598,7 +3598,7 @@ msgstr ""
35983598#, no-wrap
35993599msgid ""
36003600"~~~~\n"
3601- "fn each(v: &[int], op: &fn( v: &int) ) {\n"
3601+ "fn each(v: &[int], op: | v: &int| ) {\n"
36023602" let mut n = 0;\n"
36033603" while n < v.len() {\n"
36043604" op(&v[n]);\n"
@@ -3622,7 +3622,7 @@ msgstr ""
36223622#, no-wrap
36233623msgid ""
36243624"~~~~\n"
3625- "# fn each(v: &[int], op: &fn( v: &int) ) { }\n"
3625+ "# fn each(v: &[int], op: | v: &int| ) { }\n"
36263626"# fn do_some_work(i: &int) { }\n"
36273627"each([1, 2, 3], |n| {\n"
36283628" do_some_work(n);\n"
@@ -3644,7 +3644,7 @@ msgstr ""
36443644#, no-wrap
36453645msgid ""
36463646"~~~~\n"
3647- "# fn each(v: &[int], op: &fn( v: &int) ) { }\n"
3647+ "# fn each(v: &[int], op: | v: &int| ) { }\n"
36483648"# fn do_some_work(i: &int) { }\n"
36493649"do each([1, 2, 3]) |n| {\n"
36503650" do_some_work(n);\n"
@@ -4011,7 +4011,7 @@ msgstr ""
40114011#, no-wrap
40124012msgid ""
40134013"~~~~\n"
4014- "fn map<T, U>(vector: &[T], function: &fn( v: &T) -> U) -> ~[U] {\n"
4014+ "fn map<T, U>(vector: &[T], function: | v: &T| -> U) -> ~[U] {\n"
40154015" let mut accumulator = ~[];\n"
40164016" for element in vector.iter() {\n"
40174017" accumulator.push(function(element));\n"
0 commit comments