OSDN Git Service

バージョンの修正.
[omake-japanese/omake_trans.git] / pervasives.rst
1 .. 12-prevasives
2
3 .. _label12:
4
5 12. 標準的なオブジェクト群
6 ==================================
7 .. Pervasives defines the objects that are defined in all programs. The following objects are defined.
8
9 ここでの『広く使われている』は、すべてのプログラムで使われているオブジェクトを意味しています。以下のオブジェクトが定義されています。
10
11 .. _label12.1:
12
13 12.1 広く使われているオブジェクト
14 ----------------------------------
15
16 .. index::
17    single: Object
18 .. _label12.1.1:
19
20 12.1.1 Object
21 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 親オブジェクト : 無し
23
24 .. The Object object is the root object. Every class is a subclass of Object.
25
26 ``Object`` オブジェクトはルートとなるオブジェクトです。すべてのクラスは ``Object`` のサブクラスです。
27
28 .. It provides the following fields:
29
30 以下のフィールドやメソッドを提供します。
31
32 .. the number of fields and methods in the object. 
33    returns true iff the <var> is a field or method of the object.
34    adds the field to the object, returning a new object. 
35    fetches the field or method from the object; it is equivalent to $(o.<var>), but the variable can be non-constant. 
36    maps a function over the object. The function should take two arguments; the first is a field name, the second is the value of that field. The result is a new object constructed from the values returned by the function. 
37    the object-foreach form is equivalent to object-map, but with altered syntax.
38
39 * ``$(o.object-length)`` : オブジェクトのメソッドとフィールドの総数
40 * ``$(o.object-mem <var>)`` : <var>がオブジェクトのフィールドやメソッドであった場合は ``true`` を返します。
41 * ``$(o.object-add <var, <value>)`` : オブジェクトにフィールドを追加した新しいオブジェクトを返します。
42 * ``$(o.object-find <var>)`` : オブジェクトのメソッドやフィールドを取得します。これは ``$(o.<var>)`` と等価ですが、変数は定数でなくても構いません。
43 * ``$(o.object-map <fun>)`` : オブジェクト全体に対して関数を適用します。この関数は二つの引数を取り、一つ目はフィールドの名前で、二番目にはフィールドの値を指定します。結果は関数によって返される値が適用された、新しいオブジェクトを返します。
44 * ``$(o.object-foreach)`` : ``object-foreach`` は ``object-map`` と等価ですが、別の構文を適用できます。 ::
45
46      o.object-foreach(<var1>, <var2>)
47         <body>
48   
49   .. For example, the following function prints all the fields of an object o.
50   
51   例えば、以下の関数はオブジェクト ``o`` のすべてのフィールドを表示します。 ::
52
53        PrintObject(o) =
54         o.object-foreach(v, x)
55            println($(v) = $(x))
56
57   .. The export form is valid in a object-foreach body. The following function collects just the field names of an object.
58
59   ``export`` 文は ``object-foreach`` の内部に適用できます。以下の関数ではオブジェクトのフィールド名を収集します。 ::
60   
61      FieldNames(o) =
62         names[] =
63         o.object-foreach(v, x)
64            names[] += $(v)
65            export
66         return $(names)
67
68 .. index::
69    single: Map
70 .. _label12.1.2:
71
72 12.1.2 Map
73 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74 親オブジェクト : ``Object``
75
76 .. A Map object is a dictionary from values to values. The <key> values are restricted to simple values: integers, floating-point numbers, strings, files, directories, and arrays of simple values.
77
78 ``Map`` オブジェクトは値から値を返す辞書です。 ``<key>`` の値は単純な型のみが使用できます。具体的には、整数型、浮動小数点型、文字列型、ファイル型、辞書型、そして単純な型で構成された配列です。
79
80 .. The Map object provides the following methods.
81
82 Mapオブジェクトは以下のメソッドを提供します。
83
84 .. the number of items in the map. 
85    returns true iff the <key> is defined in the map. 
86    adds the field to the map, returning a new map. 
87    fetches the field from the map. 
88    fetches an array of all the keys in the map, in alphabetical order. 
89    fetches an array of all the values in the map, in the alphabetical order of the corresponding keys.
90    maps a function over the map. The function should take two arguments; the first is a field name, the second is the value of that field. The result is a new object constructed from the values returned by the function. 
91    the foreach form is equivalent to map, but with altered syntax.
92
93 * ``$(o.length)`` : 辞書に格納されているアイテムの総数
94 * ``$(o.mem <key>)`` : ``<key>`` が辞書に定義されている場合は ``true`` を返します。
95 * ``$(o.add <key>, <value>)`` : 辞書にフィールドを追加した、新しい辞書を返します。
96 * ``$(o.find <key>)`` : 辞書から対象のフィールドを取得します。
97 * ``$(o.keys)`` : 辞書の中にあるすべてのキーの配列をアルファベット順で取得します。
98 * ``$(o.values)`` : 辞書の中にあるすべての値の配列を、キーのアルファベット順で取得します。
99 * ``$(o.map <fun>)`` : 一つ目はフィールドの名前で、二番目にはフィールドの値を指定します。結果は関数によって返される値が適用された、新しいオブジェクトを返します。
100 * ``$(o.foreach)`` : ``foreach`` 文は ``map`` と等価ですが、別の構文を適用できます。 ::
101
102      o.foreach(<var1>, <var2>)
103         <body>
104   
105   .. For example, the following function prints all the fields of an object o.
106   
107   例えば、以下の関数はオブジェクト ``o`` のすべてのフィールドを表示します。 ::
108
109      PrintObject(o) =
110         o.foreach(v, x)
111            println($(v) = $(x))
112   
113   .. The export form is valid in a foreach body. The following function collects just the field names of the map.
114    
115   ``export`` 文は ``object-foreach`` の内部に適用できます。以下の関数では辞書のフィールド名を収集します。 ::
116
117      FieldNames(o) =
118         names =
119         o.foreach(v, x)
120            names += $(v)
121            export
122         return $(names)
123
124 .. There is also simpler syntax when the key is a string. The table can be defined using definitions with the form $|key| (the number of pipe symbols | is allowed to vary).
125
126 キーが文字列である場合には単純な記法が用意されています。キー-値のテーブルは ``$|key|`` の文を用いて定義することができます(パイプシンボル ``|`` の数は、多様性のためにいくらでも使うことができます)。 ::
127
128     $|key 1| = value1
129     $||key1|key2|| = value2    # キーは key1|key2
130     X = $|key 1|               # Xにフィールドの値 $|key 1| を定義
131
132 .. The usual modifiers are also allowed. The expression $`|key| represents lazy evaluation of the key, and $,|key| is normal evaluation.
133
134 通常用いる修飾子も適用できます。式 ``$`|key|`` はキーの遅延評価として解釈されて、また式 ``$,|key|`` は通常の評価を行います。
135
136 .. index::
137    single: Number
138 .. _label12.1.3:
139
140 12.1.3 Number
141 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
142 親オブジェクト : ``Object``
143
144 .. The Number object is the parent object for integers and floating-point numbers. 
145
146 ``Number`` オブジェクトは整数や浮動小数点の親オブジェクトです。
147
148 .. index::
149    single: Int
150 .. _label12.1.4:
151
152 12.1.4 Int
153 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154 親オブジェクト : ``Number``
155
156 .. The Int object represents integer values. 
157
158 ``Int`` オブジェクトは整数を表現します。
159
160 .. index::
161    single: Float
162 .. _label12.1.5:
163
164 12.1.5 Float
165 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166 親オブジェクト : ``Number``
167
168 .. The Float object represents floating-point numbers. 
169
170 ``Float`` オブジェクトは浮動小数点を表現します。
171
172 .. index::
173    single: Sequence
174 .. _label12.1.6:
175
176 12.1.6 Sequence
177 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178 親オブジェクト : ``Object``
179
180 .. The Sequence object represents a generic object containing sequential elements. It provides the following methods.
181
182 ``Sequence`` オブジェクトは一次元的に成分が格納されている、一般的なオブジェクトを表現します。このオブジェクトは以下のメソッドを提供しています。
183
184 .. the number of elements in the sequence. 
185    maps a function over the fields in the sequence. The function should take one argument. The result is a new sequence constructed from the values returned by the function.
186    the foreach form is equivalent to map, but with altered syntax.
187
188 * ``$(s.length)`` : シーケンスの長さを返します。
189 * ``$(s.map <fun>)`` : シーケンスのフィールド全体に対して関数を適用します。この関数は一つの引数を取ります。結果は関数によって返される値からなる、新しいシーケンスを返します。
190 * ``$(s.foreach)`` : ``foreach`` 文は ``map`` と等価ですが、別の構文を適用できます。 ::
191
192      s.foreach(<var>)
193         <body>
194   
195   .. For example, the following function prints all the elements of the sequence.
196   
197   例えば、以下の関数ではシーケンスのすべての成分を表示します。 ::
198
199      PrintSequence(s) =
200         s.foreach(x)
201            println(Elem = $(x))
202   
203   .. The export form is valid in a foreach body. The following function counts the number of zeros in the sequence.
204   
205   ``export`` 文は ``foreach`` の内部に適用できます。以下の関数はシーケンスの0の数を数えます。 ::
206   
207      Zeros(s) =
208         count = $(int 0)
209         s.foreach(v)
210            if $(equal $(v), 0)
211               count = $(add $(count), 1)
212               export
213            export
214         return $(count)
215
216 .. tests whether each element of the sequence satifies a predicate. 
217
218 * ``$(s.forall <fun>)`` : シーケンスの各々の成分が、与えられた関数の評価を満足しているかどうか調べます。
219
220 .. tests whether the sequence contains an element that satisfies a predicate. 
221
222 * ``$(s.exists <fun>)`` : シーケンスに与えられた関数の評価を満足するような成分があるかどうか調べます。
223
224 .. sorts a sequence. The <fun> is a comparison function. It takes two elements (x, y) of the sequence, compares them, and returns a negative number if x < y, a positive number if x > y, and zero if the two elements are equal.
225
226 * ``$(s.sort <fun>)`` : シーケンスをソートします。 ``<fun>`` は比較用の関数です。この関数は二つの成分 ``(x, y)`` を持つシーケンスを引数に取り、x,yを比較して、もし x < y であったのなら負の値を返し、 x > y であったなら正の値を返し、二つの成分が等価であったなら0を返します。 ::
227
228     osh> items = $(int 0 3 -2)
229     osh> items.forall(x => $(gt $x, 0))
230     - : bool = false
231     osh> items.exists(x => $(gt $x, 0))
232     - : bool = true
233     osh> items.sort($(compare))
234     - : Array = -2 3 0
235
236
237 .. index::
238    single: Array
239 .. _label12.1.7:
240
241 12.1.7 Array
242 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
243 親オブジェクト : ``Sequence``
244
245 .. The Array is a random-access sequence. It provides the following additional methods.
246
247 ``Array`` は自由にアクセスできるシーケンスです。このオブジェクトは以下の追加メソッドを提供しています。
248
249 .. returns element i of the sequence. 
250    returns the reversed sequence. 
251
252 * ``$(s.nth <i>)`` : シーケンスの ``i`` 番めの成分を返します。
253 * ``$(s.rev <i>)`` : 逆転させたシーケンスを返します。
254
255 .. index::
256    single: String
257 .. _label12.1.8:
258
259 12.1.8 String
260 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
261 親オブジェクト : ``Array``
262
263 .. index::
264    single: Fun
265 .. _label12.1.9:
266
267 12.1.9 Fun
268 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
269 親オブジェクト : ``Object``
270
271 .. The Fun object provides the following methods. 
272
273 ``Fun`` オブジェクトは以下のメソッドを提供しています。
274
275 .. the arity if the function. 
276
277 * ``$(f.arity)`` : 関数の場合はアリティ(関数が取る引数の個数)を返します。
278
279 .. index::
280    single: Rule
281 .. _label12.1.10:
282
283 12.1.10 Rule
284 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
285 親オブジェクト : ``Object``
286
287 .. The Rule object represents a build rule. It does not currently have any methods. 
288
289 ``Rule`` オブジェクトはビルドルールを表現します。これは現在なんのメソッドも持っていません。
290
291 .. index::
292    single: Target
293 .. _label12.1.11:
294
295 12.1.11 Target
296 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
297 親オブジェクト : ``Object``
298
299 .. The Target object contains information collected for a specific target file.
300
301 ``Target`` オブジェクトは指定したターゲットファイルの情報を収集しているオブジェクトです。
302
303 .. the target file. 
304    the files that may be modified by a side-effect when this target is built. 
305    static dependencies that must be built before this target can be scanned. 
306    statically-defined build dependencies of this target. 
307    all the build dependencies for the target, including static and scanned dependencies. 
308    all the value dependencies associated with the build.
309    the commands to build the target. 
310    if output was diverted to a file, with one of the --output-* options A, this field names that file. Otherwise it is false. 
311
312 * ``target`` : ターゲットファイル
313 * ``effects`` : ターゲットがビルドされたときに、副次的に修正されるであろうファイル群
314 * ``scanner_deps`` : ターゲットがスキャンできるようになる前にビルドしなければならない静的な依存関係
315 * ``static-deps`` : 静的に定義されている、ターゲットの依存関係
316 * ``build-deps`` : 静的、あるいはスキャンされた依存関係を含む、ターゲットに対するすべての依存関係
317 * ``build-values`` : ビルドに関係している、すべての依存関係の値
318 * ``build-commands`` : ターゲットをビルドするためのコマンド
319 * ``output-file`` : ``--output-*`` オプション( :ref:`labelA.2.8` 以降を参照)を用いて、出力が適当なファイルに書き込まれるような場合、このフィールドはファイル名を表します。そうでない場合は ``false`` を示します。
320
321 .. The object supports the following methods.
322
323 このオブジェクトは以下のメソッドをサポートしています。
324
325 .. returns a Target object for the given file. Raises a RuntimeException if the specified target is not part of the project. 
326    returns a Target object for the given file, or false if the file is not part of the project. 
327
328 * ``find(file)`` : 与えられたファイルのターゲットオブジェクトを返します。指定したターゲットがプロジェクトの一部でない場合は ``RuntimeException`` を送出します。
329 * ``find-optional(file)`` : 与えられたファイルのターゲットオブジェクトを返します。指定したターゲットがプロジェクトの一部でない場合は ``false`` を返します。
330
331 .. NOTE: the information for a target is constructed dynamically, so it is possible that the Target object for a node will contain different values in different contexts. The easiest way to make sure that the Target information is complete is to compute it within a rule body, where the rule depends on the target file, or the dependencies of the target file.
332
333 .. note::
334   ターゲットの情報は動的に構築されるので、あるノードの ``Target`` オブジェクトは異なる箇所で異なった値を含む場合があります。 ``Target`` の情報が完全にするためのもっとも簡単な方法は、対象のターゲットファイルに依存しているルール中、もしくは対象のターゲットファイルの依存関係の中で ``Target`` オブジェクトを計算することです。
335
336 .. index::
337    single: Node
338 .. _label12.1.12:
339
340 12.1.12 Node
341 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
342 親オブジェクト : ``Object``
343
344 .. The Node object is the parent object for files and directories. It supports the following operations. 
345
346 ``Node`` オブジェクトはファイルやディレクトリの親オブジェクトです。このオブジェクトは以下の操作をサポートしています。
347
348 .. returns a stat object for the file. If the file is a symbolic link, the stat information is for the destination of the link, not the link itself.
349    returns a stat object for the file or symbolic link.
350    removes the file. 
351    renames the file. 
352    creates a hard link <dst> to this file. 
353    create a symbolic link <dst> to this file. 
354    change the permission of this file. 
355    change the owner and group id of this file. 
356
357 * ``$(node.stat)`` : ファイルの ``stat`` オブジェクトを返します。もしファイルがシンボリックリンクであったなら、 ``stat`` の情報はリンク先になります。リンク自身ではありません。
358 * ``$(node.lstat)`` : ファイルか、シンボリックリンクの ``stat`` オブジェクトを返します。
359 * ``$(node.unlink)`` : ファイルを消去します。
360 * ``$(node.rename <file>)`` : ファイルをリネームします。
361 * ``$(node.link <dst>)`` : このファイルのハードリンクを ``<dst>`` に生成します。
362 * ``$(node.symlink <file>)`` : このファイルのシンボリックリンクを ``<dst>`` に生成します。
363 * ``$(node.chmod <perm>)`` : このファイルのパーミッションを変更します。
364 * ``$(node.chown <uid>, <gid>)`` : このファイルの所有者とグループIDを変更します。
365
366 .. index::
367    single: File
368 .. _label12.1.13:
369
370 12.1.13 File
371 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
372 親オブジェクト : ``Node``
373
374 .. The file object represents the name of a file. 
375
376 ``File`` オブジェクトはファイル名を表現します。
377
378 .. index::
379    single: Dir
380 .. _label12.1.14:
381
382 12.1.14 Dir
383 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
384 親オブジェクト : ``Node``
385
386 .. The Dir object represents the name of a directory. 
387
388 ``Dir`` オブジェクトはディレクトリ名を表現します。
389
390 .. index::
391    single: Channel
392 .. _label12.1.15:
393
394 12.1.15 Channel
395 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
396 親オブジェクト : ``Object``
397
398 .. A Channel is a generic IO channel. It provides the following methods. 
399
400 ``Channel`` オブジェクトは一般的なIOチャネルを表現します。このオブジェクトは以下のメソッドを提供しています。
401
402 .. close the channel. 
403    returns the file name associated with the channel. 
404
405 * ``$(o.close)`` : チャネルを閉じます。
406 * ``$(o.name)`` : チャネルに関係しているファイル名を返します。
407
408 .. index::
409    single: InChannel
410 .. _label12.1.16:
411
412 12.1.16 InChannel
413 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
414 親オブジェクト : ``Channel``
415
416 .. A InChannel is an input channel. The variable stdin is the standard input channel.
417
418 ``InChannel`` は入力チャネルです。変数 ``stdin`` は標準入力チャネルです。
419
420 .. It provides the following methods. 
421
422 このオブジェクトは以下のメソッドを提供しています。
423
424 .. open a new input channel. 
425    open a new input channel, using a string as input. 
426    reads the given number of characters from the channel 
427    reads a line from the channel 
428
429 * ``$(InChannel.fopen <file>)`` : 新しい入力チャネルを開きます。
430 * ``$(InChannel.of-string <string>)`` : 文字列を入力として、新しい入力チャネルを開きます。
431 * ``$(o.read <number>)`` : チャネルから、与えられた数だけ文字を読み込みます。
432 * ``$(o.readln)`` : チャネルから一行を読み込みます。
433
434 .. index::
435    single: OutChannel
436 .. _label12.1.17:
437
438 12.1.17 OutChannel
439 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
440 親オブジェクト : ``Channel``
441
442 .. A OutChannel is an output channel. The variables stdout and stderr are the standard output and error channels.
443
444 ``OutChannel`` は出力チャネルです。変数 ``stdout`` と ``stderr`` は標準出力とエラーチャネルです。
445
446 .. It provides the following methods. 
447
448 このオブジェクトは以下のメソッドを提供しています。
449
450 .. open a new output channel. 
451    open a new output channel, writing to a string. 
452    get the current string of output, for an output channel created as OutChannel.open-string. 
453    opens a new output channel, appending to the file. 
454    flush the output channel. 
455    print a string to the channel. 
456    print a string to the channel, followed by a line terminator. 
457
458 * ``$(OutChannel.fopen <file>)`` : 新しい出力チャネルを開きます。
459 * ``$(OutChannel.string)`` : 文字列を書き込む、新しい出力チャネルを開きます。
460 * ``$(OutChannel.to-string)`` : 現在の出力チャネルの文字列を取得します。これは ``OutChannel.open-string`` を使って作られた、出力チャネル用のメソッドです。
461 * ``$(OutChannel.append)`` : ファイルを追加した、新しい出力チャネルを開きます。
462 * ``$(c.flush)`` : 出力チャネルをクリアします。
463 * ``$(c.print <string>)`` : チャネルに文字列を出力します。
464 * ``$(c.print <string>)`` : チャネルに、改行コードを付与した文字列を出力します。
465
466 .. index::
467    single: Location
468 .. _label12.1.18:
469
470 12.1.18 Location
471 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
472 親オブジェクト : ``Location``
473
474 .. The Location object represents a location in a file. 
475
476 ``Location`` オブジェクトはファイルの位置を表現します。
477
478 .. index::
479    single: Exception
480 .. _label12.1.19:
481
482 12.1.19 Exception
483 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
484 親オブジェクト : ``Object``
485
486 .. The Exception object is used as the base object for exceptions. It has no fields. 
487
488 ``Exception`` オブジェクトは例外の基底となるオブジェクトとして用いられます。このオブジェクトはなんのフィールドやメソッドを持ちません。
489
490 .. index::
491    single: RuntimeException
492 .. _label12.1.20:
493
494 12.1.20 RuntimeException
495 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
496 親オブジェクト : ``Exception``
497
498 .. The RuntimeException object represents an exception from the runtime system. It has the following fields.
499
500 ``RuntimeException`` オブジェクトはランタイムシステムからの例外を表現します。このオブジェクトは以下のフィールドを持ちます。
501
502 .. a string representing the location where the exception was raised.
503    a string containing the exception message. 
504
505 * ``position`` : 例外が送出された位置を表現している文字列
506 * ``message`` : 例外のメッセージを保持している文字列
507
508 .. index::
509    single: UnbuildableException
510 .. _label12.1.21:
511
512 12.1.21 UnbuildableException
513 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
514 親オブジェクト : ``Exception``
515
516 .. The UnbuildableException object should be used to signal that a target is not buildable. It will be caught by functions such as target-exists. This exception has the following fields:
517
518 ``UnbuildableException`` オブジェクトはターゲットがビルドできないことを知らせるために用いられます。このオブジェクトは ``target-exists()`` のような関数を使った場合に捕えられます。この例外は以下のフィールドを持ちます。
519
520 .. indicates which target is not buildable. 
521    a string containing the exception message. 
522
523 * ``target`` : どのターゲットがビルドできないのかを示します。
524 * ``message`` : 例外のメッセージを含んでいる文字列
525
526 .. index::
527    single: Shell
528    single: echo()
529    single: jobs()
530    single: cd()
531    single: bg()
532    single: fg()
533    single: stop()
534    single: wait()
535    single: kill()
536    single: which()
537    single: where()
538    single: rehash()
539    single: ln-or-cp()
540    single: history()
541    single: digest()
542    single: grep()
543    single: pwd()
544    single: mkdir()
545    single: cp()
546    single: mv()
547    single: rm()
548    single: chmod()
549    single: cat()
550    single: test()
551    single: find()
552 .. _label12.1.22:
553
554 12.1.22 Shell
555 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
556 親オブジェクト : ``Object``
557
558 .. The Shell object contains the collection of builtin functions available as shell commands.
559
560 ``Shell`` オブジェクトはシェルコマンドとして利用できるビルドイン関数のコレクションを含んでいます。
561
562 .. You can define aliases by extending this object with additional methods. All methods in this class are called with one argument: a single array containing an argument list.
563
564 あなたはこのオブジェクトにメソッドを追加し拡張することで、エイリアスを定義することができます。このクラスの中にあるすべてのメソッドは一つの引数をとる必要があります。引数には引数のリストが含まれた、単純な配列が与えられます。
565
566 * ``echo``
567   
568   .. The echo function prints its arguments to the standard output channel. 
569   
570   ``echo`` 関数は引数を標準出力チャネルに表示します。
571
572 * ``jobs``
573   
574   .. The jobs method prints the status of currently running commands. 
575
576   ``jobs`` メソッドは現在実行しているコマンドの状態を表示します。
577   
578 * ``cd``
579   
580   .. The cd function changes the current directory. Note that the current directory follows the usual scoping rules. For example, the following program lists the files in the foo directory, but the current directory is not changed.
581   
582   ``cd`` 関数はカレントディレクトリを変更します。カレントディレクトリは現在のスコーピングルールに従うことに注意してください。例えば、以下のプログラムでは ``foo`` ディレクトリのファイルをリストしていますが、カレントディレクトリは変更されません。 ::
583   
584      section
585         echo Listing files in the foo directory...
586         cd foo
587         ls
588
589      echo Listing files in the current directory...
590      ls
591
592 * ``bg``
593   
594   .. The bg method places a job in the background. The job is resumed if it has been suspended. 
595   
596   ``bg`` メソッドはバックグラウンドにジョブを移します。ジョブが中断(suspended)されている場合、そのジョブは再開されます。
597
598 * ``fg``
599   
600   .. The fg method brings a job to the foreground. The job is resumed if it has been suspended. 
601   
602   ``fg`` メソッドはジョブをフォアグラウンドに持っていきます。ジョブが中断されている場合、そのジョブは再開されます。
603   
604 * ``stop``
605   
606   .. The stop method suspends a running job. 
607   
608   ``stop`` 関数は実行しているジョブを中断します。
609
610 * ``wait``
611   
612   .. The wait function waits for a running job to terminate. It is not possible to wait for a suspended job.
613   
614   ``wait`` 関数は実行しているジョブが終了するまで待機します。この関数は、中断しているジョブを待機することができません。
615   
616   .. The job is not brought to the foreground. If the wait is interrupted, the job continues to run in the background. 
617   
618   ジョブをフォアグラウンドに持っていくことはしません。また、 ``wait`` が割り込まれた場合、ジョブはバックグラウンド上で実行し続けます。
619
620 * ``kill``
621   
622   .. The kill function signal a job.
623   
624   ``kill`` 関数はジョブにシグナルを送ります。 ::
625   
626     kill [signal] <pid...>.
627   
628   .. The signals are either numeric, or symbolic. The symbolic signals are named as follows.
629   
630   シグナルは数値かシンボリックのどちらでも構いません。シンボリックシグナルは以下のように命名されています。
631   
632   ABRT, ALRM, HUP, ILL, KILL, QUIT, SEGV, TERM, USR1, USR2, CHLD, STOP, TSTP, TTIN, TTOU, VTALRM, PROF
633
634 * ``exit``
635   
636   .. The exit function terminates the current session. 
637   
638   ``exit`` 関数は現在のセッションを終了します。
639
640 * ``which`` , ``where``
641   
642   .. See the documentation for the corresponding functions. 
643   
644   相当する関数のドキュメントを参照してください。
645
646 * ``rehash``
647   
648   .. Reset the search path. 
649   
650   検索パスをリセットします。
651
652 * ``ln-or-cp`` *src dst*
653   
654   .. Links or copies src to dst, overwriting dst. Namely, ln-or-cp would first delete the dst file (unless it is a directory), if it exists. Next it would try to create a symbolic link dst poiting to src (it will make all the necessary adjustmnents of relative paths). If symbolic link can not be created (e.g. the OS or the filesystem does not support symbolic links), it will try to create a hard link. If that fails too, it will try to forcibly copy src to dst. 
655   
656   *src* を *dst* にリンクもしくはコピーします。 *dst* は上書きされます。通常、 ``ln-or-cp`` は初めに出力先のファイルを(存在している場合は)消去します。次にこの関数は入力先のファイルを指し示しているシンボリックリンクを出力先に生成します(パスはできる限り相対パスとして設定されます)。シンボリックリンクが生成できない場合(例. OSやファイルシステムがシンボリックリンクをサポートしていない場合)、この関数はハードリンクを生成しようと試みます。もしこの試みも失敗したのなら、強制的に入力先のファイルを出力先にコピーしようと試みます。
657
658 * ``history``
659   
660   .. Print the current command-line history. 
661   
662   現在のコマンドライン履歴を表示します。
663
664 * ``digest``
665   
666   .. Print the digests of the given files. 
667   
668   与えられたファイルの要約を出力します。
669
670 * Win32 関数群
671   
672   .. Win32 doesn't provide very many programs for scripting, except for the functions that are builtin to the DOS cmd.exe. The following functions are defined on Win32 and only on Win32. On other systems, it is expected that these programs already exist.
673   
674   Win32ではスクリプトのために使える、多くのプログラム(DOS ``cmd.exe`` に含まれている関数を除く)を提供しています。以下の関数はWin32で定義されており、Win32上でしか使えません。他のシステム上では、この関数はすでに存在している他のプログラムに置き換わることになるでしょう。
675   
676   * ``grep``
677     ::
678
679        grep [-q] [-n] pattern files...
680     
681     .. The grep function calls the omake grep function. 
682     
683     ``grep`` 関数はomakeの ``grep`` 関数を呼び出します。
684
685 .. Internal versions of standard system commands.
686
687 * omake内部の標準システムコマンド
688   
689   .. By default, omake uses internal versions of the following commands: cp, mv, cat, rm, mkdir, chmod, test, find. If you really want to use the standard system versions of these commands, set the USE_SYSTEM_COMMANDS as one of the first definitions in your OMakeroot file.
690   
691   通常、以下のコマンドはomakeが内部に保有している関数を使います: ``cp`` , ``mv`` , ``cat`` , ``rm`` , ``mkdir`` , ``chmod`` , ``test`` , ``find`` 。もしあなたがどうしてもこれらのコマンドを、システムが標準で使っているコマンドで呼び出したいのなら、 ``USE_SYSTEM_COMMANDS`` を ``OMakeroot`` ファイルの先頭に設定してください。
692   
693   * ``pwd``
694     ::
695     
696         pwd
697     
698     .. The pwd alias would print the absolute path to current directory.
699     
700     ``pwd`` エイリアスはカレントディレクトリの絶対パスを表示します。
701   
702   * ``mkdir``
703     ::
704     
705         mkdir [-m <mode>] [-p] files
706     
707     .. The mkdir function is used to create directories. The -verb+-m+ option can be used to specify the permission mode of the created directory. If the -p option is specified, the full path is created. 
708     
709     ``mkdir`` 関数はディレクトリを生成します。 ``-m`` オプションには生成されるディレクトリのパーミッションを指定します。 ``-p`` オプションが指定された場合、存在しない親ディレクトリもまとめて生成します。
710   
711   * ``cp``
712     
713   * ``mv``
714     ::
715     
716         cp [-f] [-i] [-v] src dst
717         cp [-f] [-i] [-v] files dst
718         mv [-f] [-i] [-v] src dst
719         mv [-f] [-i] [-v] files dst
720     
721     .. The cp function copies a src file to a dst file, overwriting it if it already exists. If more than one source file is specified, the final file must be a directory, and the source files are copied into the directory.
722     
723     ``cp`` 関数は ``src`` ファイルを ``dst`` ファイルにコピーします。出力先のファイルが存在している場合は上書きします。一つ以上の入力ファイルが指定された場合、最後のファイルはディレクトリでなければならず、入力ファイルはそのディレクトリの内部にコピーされます。
724
725     * **-f**
726       
727       .. Copy files forcibly, do not prompt. 
728       
729       確認をしないで、強制的にファイルをコピーします。
730     
731     * **-i**
732       
733       .. Prompt before removing destination files. 
734       
735       出力先のファイルを消去する前に確認します。
736     
737     * **-v**
738       
739       .. Explain what is happening. 
740       
741       実際になにが行われているのか表示します。
742   
743   * ``rm``
744     ::
745     
746        rm [-f] [-i] [-v] [-r] files
747        rmdir [-f] [-i] [-v] [-r] dirs
748     
749     .. The rm function removes a set of files. No warnings are issued if the files do not exist, or if they cannot be removed.
750     
751     ``rm`` 関数はファイルの集合を消去します。ファイルが存在しなかった場合、もしくはファイルが消去できなかった場合、なんの警告も表示しません。
752     
753     オプション:
754     
755     * **-f**
756       
757       .. Forcibly remove files, do not prompt. 
758       
759       確認をしないで、強制的にファイルを消去します。
760     
761     * **-i**
762       
763       .. Prompt before removal. 
764       
765       ファイルを消去する前に確認します。
766     
767     * **-v**
768       
769       .. Explain what is happening. 
770       
771       実際になにが行われているのか表示します。
772     
773     * **-r**
774       
775       .. Remove contents of directories recursively. 
776       
777       再帰的にディレクトリの内容を消去します。
778   
779   * ``chmod``
780     ::
781     
782         chmod [-r] [-v] [-f] mode files
783     
784     .. The chmod function changes the permissions on a set of files or directories. This function does nothing on Win32. The mode may be specified as an octal number, or in symbolic form [ugoa]*[-=][rwxXstugo]+. See the man page for chmod for details.
785     
786     ``chmod`` 関数はファイルの集合やディレクトリのパーミッションを変更します。この関数はWin32上ではなにも行いません。 ``mode`` には8進数か、シンボリックフォーム ``[ugoa]*[-=][rwxXstugo]+`` を指定します。詳細は ``chmod`` のmanを参照してください。
787     
788     オプション:
789     
790     * **-r**
791       
792       .. Change permissions of all files in a directory recursively. 
793       
794       ディレクトリ内のすべてのファイルのパーミッションを再帰的に変更します。
795     
796     * **-v**
797       
798       .. Explain what is happening. 
799       
800       実際になにが行われているのか表示します。
801       
802     * **-f**
803       
804       .. Continue on errors. 
805       
806       エラーが生じても実行し続けます。
807   
808   * ``cat``
809     ::
810     
811        cat files...
812     
813     .. The cat function prints the contents of the files to stdout 
814     
815     ``cat`` 関数はファイルの内容をstdoutに出力します。
816   
817   * ``test``
818     ::
819     
820       test expression
821       [ expression +]+
822       [ --help
823       [ --version
824     
825     .. See the documentation for the test function.
826     
827     詳細は ":ref:`label10.7.1`" を参照してください。
828   
829   * ``find``
830     ::
831     
832       find expression
833     
834     .. See the documentation for the find function.
835     
836     詳細は ":ref:`label10.7.2`" を参照してください。