]> git.lizzy.rs Git - rust.git/blob - src/doc/po/ja/guide-lifetimes.md.po
Bump version to 0.10
[rust.git] / src / doc / po / ja / guide-lifetimes.md.po
1 # Japanese translations for Rust package
2 # Copyright (C) 2014 The Rust Project Developers
3 # This file is distributed under the same license as the Rust package.
4 # Automatically generated, 2014.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: Rust 0.10\n"
9 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
10 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
11 "Last-Translator: Automatically generated\n"
12 "Language-Team: none\n"
13 "Language: ja\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17 "Plural-Forms: nplurals=1; plural=0;\n"
18
19 #. type: Plain text
20 #: src/doc/guide-conditions.md:4 src/doc/guide-ffi.md:4
21 #: src/doc/guide-lifetimes.md:4 src/doc/guide-macros.md:4
22 #: src/doc/guide-tasks.md:4 src/doc/rust.md:4 src/doc/tutorial.md:4
23 msgid "# Introduction"
24 msgstr "# イントロダクション"
25
26 #. type: Plain text
27 #: src/doc/guide-lifetimes.md:2
28 #, fuzzy
29 #| msgid "% The Rust Language Tutorial"
30 msgid "% The Rust References and Lifetimes Guide"
31 msgstr "% Rust 言語チュートリアル"
32
33 #. type: Plain text
34 #: src/doc/guide-lifetimes.md:26
35 #, fuzzy
36 #| msgid "## A minimal example"
37 msgid "# By example"
38 msgstr "## 最小限の例"
39
40 #. type: Plain text
41 #: src/doc/guide-lifetimes.md:33
42 #, fuzzy
43 #| msgid "As an example, consider a simple struct type, `Point`:"
44 msgid "As an example, consider a simple struct type `Point`:"
45 msgstr "例として、シンプルな構造体型の `Point` について考えます。"
46
47 #. type: Plain text
48 #: src/doc/guide-lifetimes.md:37
49 #, fuzzy
50 #| msgid ""
51 #| "~~~ # struct Point { x: f64, y: f64 } let point = &@~Point { x: 10f, y: "
52 #| "20f }; println(fmt!(\"%f\", point.x)); ~~~"
53 msgid "~~~ struct Point {x: f64, y: f64} ~~~"
54 msgstr ""
55 "~~~\n"
56 "# struct Point { x: f64, y: f64 }\n"
57 "let point = &@~Point { x: 10f, y: 20f };\n"
58 "println(fmt!(\"%f\", point.x));\n"
59 "~~~"
60
61 #. type: Plain text
62 #: src/doc/guide-lifetimes.md:41
63 #, fuzzy
64 #| msgid ""
65 #| "We can use this simple definition to allocate points in many different "
66 #| "ways. For example, in this code, each of these three local variables "
67 #| "contains a point, but allocated in a different location:"
68 msgid ""
69 "We can use this simple definition to allocate points in many different ways. "
70 "For example, in this code, each of these three local variables contains a "
71 "point, but allocated in a different place:"
72 msgstr ""
73 "シンプルな定義ですが、この定義を使って `Point` 型のオブジェクトを様々な方法で"
74 "割り当てることができます。例えば、このコードの3つのローカル変数は、それぞれ異"
75 "なった場所に `Point` 型のオブジェクトを割り当てています。"
76
77 #. type: Plain text
78 #: src/doc/guide-lifetimes.md:48
79 #, fuzzy, no-wrap
80 #| msgid "~~~~ {.ignore} # struct Point { x: f64, y: f64 } let mut mypoint = Point { x: 1.0, y: 1.0 }; let origin = Point { x: 0.0, y: 0.0 };"
81 msgid ""
82 "~~~\n"
83 "# struct Point {x: f64, y: f64}\n"
84 "let on_the_stack :  Point =  Point {x: 3.0, y: 4.0};\n"
85 "let managed_box  : @Point = @Point {x: 5.0, y: 1.0};\n"
86 "let owned_box    : ~Point = ~Point {x: 7.0, y: 9.0};\n"
87 "~~~\n"
88 msgstr ""
89 "~~~~ {.ignore}\n"
90 "# struct Point { x: f64, y: f64 }\n"
91 "let mut mypoint = Point { x: 1.0, y: 1.0 };\n"
92 "let origin = Point { x: 0.0, y: 0.0 };"
93
94 #. type: Plain text
95 #: src/doc/guide-lifetimes.md:60
96 #, fuzzy
97 #| msgid ""
98 #| "Suppose we want to write a procedure that computes the distance between "
99 #| "any two points, no matter where they are stored. For example, we might "
100 #| "like to compute the distance between `on_the_stack` and `managed_box`, or "
101 #| "between `managed_box` and `owned_box`. One option is to define a function "
102 #| "that takes two arguments of type point—that is, it takes the points by "
103 #| "value. But this will cause the points to be copied when we call the "
104 #| "function. For points, this is probably not so bad, but often copies are "
105 #| "expensive. So we’d like to define a function that takes the points by "
106 #| "pointer. We can use borrowed pointers to do this:"
107 msgid ""
108 "Suppose we wanted to write a procedure that computed the distance between "
109 "any two points, no matter where they were stored. For example, we might like "
110 "to compute the distance between `on_the_stack` and `managed_box`, or between "
111 "`managed_box` and `owned_box`. One option is to define a function that takes "
112 "two arguments of type `Point`—that is, it takes the points by value. But if "
113 "we define it this way, calling the function will cause the points to be "
114 "copied. For points, this is probably not so bad, but often copies are "
115 "expensive. Worse, if the data type contains mutable fields, copying can "
116 "change the semantics of your program in unexpected ways. So we'd like to "
117 "define a function that takes the points by pointer. We can use references to "
118 "do this:"
119 msgstr ""
120 "`Point` 型のオブジェクトの割り当て先がどこであったとしても利用可能な、任意の "
121 "2 点間の距離を計算する処理を書きたいとします。例えば、 `on_the_stack`, "
122 "`managed_box` 間や `managed_box`, `owned_box` 間の距離を計算する処理です。 1"
123 "つ目の実装方法として、2つの `Point` 型オブジェクトを引数にとる関数を定義する"
124 "方法、すなわち、オブジェクトを値で受け渡す方法があります。しかし、この方法で"
125 "は関数呼び出し時に `Point` オブジェクトのコピーが行われます。`Point` オブジェ"
126 "クトの場合、このような実装はそれほど悪いものではないでしょうが、コピー処理の"
127 "コストは高い場合もあります。したがって、`Point` オブジェクトをポインタ渡しす"
128 "る関数を定義する必要があります。そのために、借用ポインタを利用することが可能"
129 "です。"
130
131 #. type: Plain text
132 #: src/doc/guide-lifetimes.md:72 src/doc/tutorial.md:1409
133 msgid "Now we can call `compute_distance()` in various ways:"
134 msgstr ""
135 "上記の `compute_distance()` 関数は、様々な方法で呼び出すことができます。"
136
137 #. type: Plain text
138 #: src/doc/guide-lifetimes.md:82
139 #, fuzzy, no-wrap
140 #| msgid "~~~~ {.ignore} # struct Point { x: f64, y: f64 } let mut mypoint = Point { x: 1.0, y: 1.0 }; let origin = Point { x: 0.0, y: 0.0 };"
141 msgid ""
142 "~~~\n"
143 "# struct Point {x: f64, y: f64}\n"
144 "# let on_the_stack :  Point =  Point{x: 3.0, y: 4.0};\n"
145 "# let managed_box  : @Point = @Point{x: 5.0, y: 1.0};\n"
146 "# let owned_box    : ~Point = ~Point{x: 7.0, y: 9.0};\n"
147 "# fn compute_distance(p1: &Point, p2: &Point) -> f64 { 0.0 }\n"
148 "compute_distance(&on_the_stack, managed_box);\n"
149 "compute_distance(managed_box, owned_box);\n"
150 "~~~\n"
151 msgstr ""
152 "~~~~ {.ignore}\n"
153 "# struct Point { x: f64, y: f64 }\n"
154 "let mut mypoint = Point { x: 1.0, y: 1.0 };\n"
155 "let origin = Point { x: 0.0, y: 0.0 };"
156
157 #. type: Plain text
158 #: src/doc/guide-lifetimes.md:89
159 #, fuzzy
160 #| msgid ""
161 #| "Here the `&` operator is used to take the address of the variable "
162 #| "`on_the_stack`; this is because `on_the_stack` has the type `Point` (that "
163 #| "is, a struct value) and we have to take its address to get a value. We "
164 #| "also call this _borrowing_ the local variable `on_the_stack`, because we "
165 #| "are creating an alias: that is, another route to the same data."
166 msgid ""
167 "Here, the `&` operator takes the address of the variable `on_the_stack`; "
168 "this is because `on_the_stack` has the type `Point` (that is, a struct "
169 "value) and we have to take its address to get a value. We also call this "
170 "_borrowing_ the local variable `on_the_stack`, because we have created an "
171 "alias: that is, another name for the same data."
172 msgstr ""
173 "ここで `&` 演算子は `on_the_stack` 変数のアドレスを取得するために使われていま"
174 "す。これは、 `on_the_stack` の型は `Point` (つまり、構造体の値) であり、呼び"
175 "出した関数から値を取得させるため、構造体のアドレスを渡す必要があるからです。"
176 "値の別名 (エイリアス)、すなわち、同じデータへアクセスするための別の方法を提供"
177 "するので、このような操作のことをローカル変数 `on_the_stack` の __借用__ "
178 "(_borrowing_) と呼びます。"
179
180 #. type: Plain text
181 #: src/doc/guide-lifetimes.md:95
182 #, fuzzy
183 #| msgid ""
184 #| "In the case of the boxes `managed_box` and `owned_box`, however, no "
185 #| "explicit action is necessary. The compiler will automatically convert a "
186 #| "box like `@point` or `~point` to a borrowed pointer like `&point`. This "
187 #| "is another form of borrowing; in this case, the contents of the managed/"
188 #| "owned box are being lent out."
189 msgid ""
190 "In contrast, we can pass the boxes `managed_box` and `owned_box` to "
191 "`compute_distance` directly. The compiler automatically converts a box like "
192 "`@Point` or `~Point` to a reference like `&Point`. This is another form of "
193 "borrowing: in this case, the caller lends the contents of the managed or "
194 "owned box to the callee."
195 msgstr ""
196 "ボックスである `managed_box` と `owned_box` の場合は、特に明示的な操作を行う"
197 "必要はありません。コンパイラは `@point` や `~point` のようなボックスを自動的"
198 "に `&point` のような借用ポインタへと変換します。これは、別の形態の借用 "
199 "(borrowing) です。この場合、マネージド/所有ボックスの内容が貸し出されていま"
200 "す。"
201
202 #. type: Plain text
203 #: src/doc/guide-lifetimes.md:105
204 #, fuzzy
205 #| msgid ""
206 #| "Whenever a value is borrowed, there are some limitations on what you can "
207 #| "do with the original. For example, if the contents of a variable have "
208 #| "been lent out, you cannot send that variable to another task, nor will "
209 #| "you be permitted to take actions that might cause the borrowed value to "
210 #| "be freed or to change its type. This rule should make intuitive sense: "
211 #| "you must wait for a borrowed value to be returned (that is, for the "
212 #| "borrowed pointer to go out of scope) before you can make full use of it "
213 #| "again."
214 msgid ""
215 "Whenever a caller lends data to a callee, there are some limitations on what "
216 "the caller can do with the original. For example, if the contents of a "
217 "variable have been lent out, you cannot send that variable to another task. "
218 "In addition, the compiler will reject any code that might cause the borrowed "
219 "value to be freed or overwrite its component fields with values of different "
220 "types (I'll get into what kinds of actions those are shortly). This rule "
221 "should make intuitive sense: you must wait for a borrower to return the "
222 "value that you lent it (that is, wait for the reference to go out of scope)  "
223 "before you can make full use of it again."
224 msgstr ""
225 "値が借用されている間、借用元の値に対して行える操作がいくらか制限されます。例"
226 "えば、変数の内容が貸し出された場合、その変数を他のタスクに送信することはでき"
227 "ませんし、借用された値を解放したり、型が変化させるような操作も行うことができ"
228 "ません。このルールは理にかなったものでしょう。貸し出した値を最大限に活用する "
229 "(make full use of it) ためには、貸し出した値の返却 (借用ポインタが存在するス"
230 "コープを抜ける) を待たなければなりません。"
231
232 #. type: Plain text
233 #: src/doc/guide-lifetimes.md:114
234 #, fuzzy
235 #| msgid ""
236 #| "~~~ # struct Point { x: f64, y: f64 } let point = &@~Point { x: 10f, y: "
237 #| "20f }; println(fmt!(\"%f\", point.x)); ~~~"
238 msgid ""
239 "~~~ # struct Point {x: f64, y: f64} let on_the_stack: Point = Point {x: 3.0, "
240 "y: 4.0}; ~~~"
241 msgstr ""
242 "~~~\n"
243 "# struct Point { x: f64, y: f64 }\n"
244 "let point = &@~Point { x: 10f, y: 20f };\n"
245 "println(fmt!(\"%f\", point.x));\n"
246 "~~~"
247
248 #. type: Plain text
249 #: src/doc/guide-lifetimes.md:124
250 #, fuzzy
251 #| msgid ""
252 #| "~~~ # struct Point { x: f64, y: f64 } let point = &@~Point { x: 10f, y: "
253 #| "20f }; println(fmt!(\"%f\", point.x)); ~~~"
254 msgid ""
255 "~~~ # struct Point {x: f64, y: f64} let on_the_stack2: &Point = &Point {x: "
256 "3.0, y: 4.0}; ~~~"
257 msgstr ""
258 "~~~\n"
259 "# struct Point { x: f64, y: f64 }\n"
260 "let point = &@~Point { x: 10f, y: 20f };\n"
261 "println(fmt!(\"%f\", point.x));\n"
262 "~~~"
263
264 #. type: Plain text
265 #: src/doc/guide-lifetimes.md:134
266 #, fuzzy
267 #| msgid ""
268 #| "~~~ # struct Point { x: f64, y: f64 } let point = &@~Point { x: 10f, y: "
269 #| "20f }; println(fmt!(\"%f\", point.x)); ~~~"
270 msgid ""
271 "~~~ # struct Point {x: f64, y: f64} let tmp = Point {x: 3.0, y: 4.0}; let "
272 "on_the_stack2 : &Point = &tmp; ~~~"
273 msgstr ""
274 "~~~\n"
275 "# struct Point { x: f64, y: f64 }\n"
276 "let point = &@~Point { x: 10f, y: 20f };\n"
277 "println(fmt!(\"%f\", point.x));\n"
278 "~~~"
279
280 #. type: Plain text
281 #: src/doc/guide-lifetimes.md:180
282 #, fuzzy
283 #| msgid "# Borrowed pointers"
284 msgid "# Borrowing managed boxes and rooting"
285 msgstr "# 借用ポインタ"
286
287 #. type: Plain text
288 #: src/doc/guide-lifetimes.md:262
289 #, fuzzy
290 #| msgid "# Borrowed pointers"
291 msgid "# Borrowing owned boxes"
292 msgstr "# 借用ポインタ"
293
294 #. type: Plain text
295 #: src/doc/guide-lifetimes.md:367
296 #, fuzzy
297 #| msgid "# Borrowed pointers"
298 msgid "# Borrowing and enums"
299 msgstr "# 借用ポインタ"
300
301 #. type: Plain text
302 #: src/doc/guide-lifetimes.md:477
303 #, fuzzy
304 #| msgid "# Dereferencing pointers"
305 msgid "# Returning references"
306 msgstr "# ポインタのデリファレンス"
307
308 #. type: Plain text
309 #: src/doc/guide-lifetimes.md:490
310 #, fuzzy
311 #| msgid ""
312 #| "~~~ # struct Point { x: f64, y: f64 } let point = &@~Point { x: 10f, y: "
313 #| "20f }; println(fmt!(\"%f\", point.x)); ~~~"
314 msgid ""
315 "~~~ struct Point {x: f64, y: f64} fn get_x<'r>(p: &'r Point) -> &'r f64 { &p."
316 "x } ~~~"
317 msgstr ""
318 "~~~\n"
319 "# struct Point { x: f64, y: f64 }\n"
320 "let point = &@~Point { x: 10f, y: 20f };\n"
321 "println(fmt!(\"%f\", point.x));\n"
322 "~~~"
323
324 #. type: Plain text
325 #: src/doc/guide-lifetimes.md:533
326 #, fuzzy, no-wrap
327 #| msgid "~~~ # struct Point { x: f64, y: f64 } let point = &@~Point { x: 10f, y: 20f }; println(fmt!(\"%f\", point.x)); ~~~"
328 msgid ""
329 "~~~ {.ignore}\n"
330 "struct Point {x: f64, y: f64}\n"
331 "fn get_x_sh(p: @Point) -> &f64 {\n"
332 "    &p.x // Error reported here\n"
333 "}\n"
334 "~~~\n"
335 msgstr ""
336 "~~~\n"
337 "# struct Point { x: f64, y: f64 }\n"
338 "let point = &@~Point { x: 10f, y: 20f };\n"
339 "println(fmt!(\"%f\", point.x));\n"
340 "~~~"
341
342 #. type: Plain text
343 #: src/doc/guide-lifetimes.md:659
344 #, fuzzy
345 #| msgid "## Conventions"
346 msgid "# Conclusion"
347 msgstr "## 本書の表記について"