Changeset 8392 for docs/nowelium
- Timestamp:
- 03/26/08 11:43:08 (5 years ago)
- Location:
- docs/nowelium/ioDocs
- Files:
-
- 2 modified
-
IoGuide_ja.alair (modified) (previous)
-
IoGuide_ja.html (modified) (35 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/nowelium/ioDocs/IoGuide_ja.html
r8176 r8392 36 36 37 37 38 <div class=indexSection><a href="#Objects"> Objects</a></div>38 <div class=indexSection><a href="#Objects">オブジェクト</a></div> 39 39 <div class=indexItem><a href="#Objects-Overview">Overview</a></div> 40 <div class=indexItem><a href="#Objects-Prototypes"> Prototypes</a></div>41 <div class=indexItem><a href="#Objects-Inheritance"> Inheritance</a></div>42 <div class=indexItem><a href="#Objects-Methods"> Methods</a></div>43 <div class=indexItem><a href="#Objects-Blocks"> Blocks</a></div>44 <div class=indexItem><a href="#Objects-Forward"> Forward</a></div>40 <div class=indexItem><a href="#Objects-Prototypes">プロトタイプ</a></div> 41 <div class=indexItem><a href="#Objects-Inheritance">継承</a></div> 42 <div class=indexItem><a href="#Objects-Methods">メソッド</a></div> 43 <div class=indexItem><a href="#Objects-Blocks">ブロック</a></div> 44 <div class=indexItem><a href="#Objects-Forward">転送</a></div> 45 45 <div class=indexItem><a href="#Objects-Resend">Resend</a></div> 46 46 <div class=indexItem><a href="#Objects-Super">Super</a></div> 47 <div class=indexItem><a href="#Objects-Introspection"> Introspection</a></div>47 <div class=indexItem><a href="#Objects-Introspection">イントロスペクション</a></div> 48 48 49 49 … … 51 51 <td valign=top style="width:33%"> 52 52 53 <div class=indexSection><a href="#Control-Flow"> Control Flow</a></div>53 <div class=indexSection><a href="#Control-Flow">制御構造</a></div> 54 54 <div class=indexItem><a href="#Control-Flow-true-false-and-nil">true, false and nil</a></div> 55 55 <div class=indexItem><a href="#Control-Flow-Comparison">Comparison</a></div> 56 <div class=indexItem><a href="#Control-Flow-Conditions"> Conditions</a></div>56 <div class=indexItem><a href="#Control-Flow-Conditions">条件分岐</a></div> 57 57 <div class=indexItem><a href="#Control-Flow-Loops">Loops</a></div> 58 58 … … 60 60 <div class=indexSection><a href="#Importing">Importing</a></div> 61 61 62 <div class=indexSection><a href="#Concurrency"> Concurrency</a></div>62 <div class=indexSection><a href="#Concurrency">並行動作</a></div> 63 63 <div class=indexItem><a href="#Concurrency-Coroutines">Coroutines</a></div> 64 64 <div class=indexItem><a href="#Concurrency-Scheduler">Scheduler</a></div> … … 68 68 <div class=indexItem><a href="#Concurrency-Pause and Resume">Pause and Resume</a></div> 69 69 70 <div class=indexSection><a href="#Exceptions"> Exceptions</a></div>70 <div class=indexSection><a href="#Exceptions">例外</a></div> 71 71 <div class=indexItem><a href="#Exceptions-Raise">Raise</a></div> 72 72 <div class=indexItem><a href="#ExceptionsTry-and-Catch">Try and Catch</a></div> … … 90 90 --> 91 91 92 <div class=indexSection><a href="#Primitives"> Primitives</a></div>92 <div class=indexSection><a href="#Primitives">プリミティブ</a></div> 93 93 <div class=indexItem><a href="#Primitives-Object">Object</a></div> 94 94 <div class=indexItem><a href="#Primitives-List">List</a></div> … … 102 102 <div class=indexItem><a href="#Primitives-Vector">Vector</a></div> 103 103 104 <div class=indexSection><a href="#Embedding"> Embedding</a></div>104 <div class=indexSection><a href="#Embedding">組み込み</a></div> 105 105 <div class=indexItem><a href="#Embedding-Conventions">Conventions</a></div> 106 106 <div class=indexItem><a href="#Embedding-IoState">IoState</a></div> 107 107 <div class=indexItem><a href="#Embedding-Values">Values</a></div> 108 108 109 <div class=indexSection><a href="#Bindings"> Bindings</a></div>109 <div class=indexSection><a href="#Bindings">バインディング</a></div> 110 110 111 111 <div class=indexSection><a href="#Appendix">Appendix</a></div> 112 112 <div class=indexItem><a href="#Appendix-Grammar">文法</a></div> 113 <div class=indexItem><a href="#Appendix-Credits"> Credits</a></div>113 <div class=indexItem><a href="#Appendix-Credits">協力者</a></div> 114 114 <div class=indexItem><a href="#Appendix-References">References</a></div> 115 115 <div class=indexItem><a href="#Appendix-License">ライセンス</a></div> … … 129 129 </div> 130 130 131 Io is a dynamic prototype-based programming language.The ideas in Io are mostly inspired by Smalltalk[1] (all values are objects), Self[2] (prototype-based), NewtonScript[3] (differential inheritance), Act1[4] (actors and futures for concurrency), Lisp[5] (code is a runtime inspectable / modifiable tree) and Lua[6] (small, embeddable).131 Io はプロトタイプベースの動的言語である。 The ideas in Io are mostly inspired by Smalltalk[1] (all values are objects), Self[2] (prototype-based), NewtonScript[3] (differential inheritance), Act1[4] (actors and futures for concurrency), Lisp[5] (code is a runtime inspectable / modifiable tree) and Lua[6] (small, embeddable). 132 132 133 133 <a name="Introduction-Perspective"></a> … … 397 397 </pre> 398 398 399 <h4> Command Line Arguments</h4>400 401 Example of printing out command line arguments:399 <h4>コマンドライン引数</h4> 400 401 コマンドライン引数を出力する例: 402 402 403 403 <pre> … … 407 407 <h4>launchPath</h4> 408 408 409 The System "launchPath" slot is set to the location on the initial source file that is executed. 409 System の "launchPath" スロットには、実行された最初のソースファイルの位置が格納されている。 410 410 411 411 </div> … … 421 421 <h3>式</h3> 422 422 423 Io has no keywords or statements. Everything is an expression composed entirely of messages, each of which is a runtime accessible object. The informal BNF description:423 Io キーワードや文を持たない。 Everything is an expression composed entirely of messages, each of which is a runtime accessible object. 非公式の BNF 記述: 424 424 425 425 <pre> … … 436 436 <h3>メッセージ</h3> 437 437 438 Message arguments are passed as expressions and evaluated by the receiver.Selective evaluation of arguments can be used to implement control flow. 例:438 メッセージ引数はレシーバに式として渡され評価される。 Selective evaluation of arguments can be used to implement control flow. 例: 439 439 440 440 <pre> … … 443 443 </pre> 444 444 445 In the above code, "for" and "if" are just normal messages, not special forms or keywords. 445 上記コードでの、"for" と "if" は通常のメッセージであり、特殊形式やキーワードでは無い。 446 446 <p> 447 447 … … 479 479 <h3>演算子</h3> 480 480 481 An operator is just a message whose name contains no alphanumeric characters (other than ":", "_", '"' or ".") or is one of the following words: or, and, return. 例:481 演算子とは、単に英数字以外の文字による名前をもつメソッドである。例外として、":"(コロン), "_"(アンダースコア), '"'(ダブルクォート), "."(ドット) は演算子に使えず、また次のものは英数字による名前だが演算子とする: "and", "or", "return". 例: 482 482 483 483 <pre> … … 485 485 </pre> 486 486 487 This just gets compiled into the normal message: 487 丁度次のような通常の形式のメッセージにコンパイルされる: 488 488 489 489 <pre> … … 491 491 </pre> 492 492 493 Which is the form you can use if you need to do grouping: 493 括弧を使ってまとめることもできる: 494 494 495 495 <pre> … … 497 497 </pre> 498 498 499 Standard operators follow C's precedence order, so: 499 標準の演算子は、C 言語と同じ優先順位で処理される。従って: 500 500 501 501 <pre> … … 503 503 </pre> 504 504 505 Is parsed as: 505 は次のように解析される: 506 506 507 507 <pre> … … 509 509 </pre> 510 510 511 User defined operators (that don't have a standard operator name) are performed left to right. 511 ユーザ定義の演算子 (標準の演算子名は使えない) は、常に左から右に動作する。 512 512 513 513 <a name="Syntax-Assignment"></a> 514 514 <h3>代入</h3> 515 515 516 Io has three assignment operators:516 Io は3つの代入演算子を持つ: 517 517 518 518 <p> … … 532 532 </td> 533 533 <td> 534 <i> Creates slot, creates setter, assigns value</i>534 <i>スロットの生成, setter の生成, 値の代入</i> 535 535 </td> 536 536 </tr> … … 541 541 </td> 542 542 <td> 543 <i> Creates slot, assigns value</i>543 <i>スロットの生成, 値の代入</i> 544 544 </td> 545 545 </tr> … … 550 550 </td> 551 551 <td> 552 <i> Assigns value to slot if it exists, otherwise raises exception</i>552 <i>スロットが存在すれば値の代入、もしなければ例外を発生する</i> 553 553 </td> 554 554 </tr> … … 557 557 <p> 558 558 559 These operators are compiled to normal messages whose methods can be overridden. For example:559 These operators are compiled to normal messages whose methods can be overridden. 例: 560 560 561 561 … … 657 657 </pre> 658 658 659 The "#" style is useful for unix scripts: 659 "#" スタイルは Unix でのスクリプトに役立ちます: 660 660 661 661 <pre> … … 663 663 </pre> 664 664 665 That's it! You now know everything there is to know about Io's syntax. Control flow, objects, methods, exceptions are expressed with the syntax and semantics described above.665 貴方は Io の文法について知るために必要なこと全てを知っている。 制御構造・オブジェクト・メソッド・例外は 上記で説明した構文で表現されます。 666 666 667 667 668 668 </div> 669 <h2> Objects<a name="Objects"></a></h2>669 <h2>オブジェクト<a name="Objects"></a></h2> 670 670 <div class=indent> 671 671 … … 720 720 721 721 <a name="Objects-Prototypes"></a> 722 <h3> Prototypes</h3>722 <h3>プロトタイプ</h3> 723 723 724 724 In Io, everything is an object (including the locals storage of a block and the namespace itself) and all actions are messages (including assignment). Objects are composed of a list of key/value pairs called slots, and an internal list of objects from which it inherits called protos. A slot's key is a symbol (a unique immutable sequence) and its value can be any type of object. … … 741 741 742 742 <a name="Objects-Inheritance"></a> 743 <h3> Inheritance</h3>743 <h3>継承</h3> 744 744 745 745 When an object receives a message it looks for a matching slot, if not found, the lookup continues depth first recursively in its protos. Lookup loops are detected (at runtime) and avoided. If the matching slot contains an activatable object, such as a Block or CFunction, it is activated, if it contains any other type of value it returns the value. Io has no globals and the root object in the Io namespace is called the Lobby. … … 761 761 </pre> 762 762 763 <h4> Multiple Inheritance</h4>763 <h4>多重継承</h4> 764 764 765 765 You can add any number of protos to an object's protos list. When responding to a message, the lookup mechanism does a depth first search of the proto chain. 766 766 767 767 <a name="Objects-Methods"></a> 768 <h3> Methods</h3>768 <h3>メソッド</h3> 769 769 770 770 A method is an anonymous function which, when called, creates an object to store its locals and sets the local's proto pointer and its self slot to the target of the message. The Object method method() can be used to create methods. 例: … … 791 791 <h4>引数</h4> 792 792 793 Methods can also be defined to take arguments.例:793 メソッドは引数をとるようにも定義できる。 例: 794 794 795 795 <pre> … … 797 797 </pre> 798 798 799 The general form is: 799 一般的な形式: 800 800 801 801 <pre><i> … … 804 804 805 805 <a name="Objects-Blocks"></a> 806 <h3> Blocks</h3>806 <h3>ブロック</h3> 807 807 808 808 A block is the same as a method except it is lexically scoped. That is, variable lookups continue in the context of where the block was created instead of the target of the message which activated the block. A block can be created using the Object method block(). Example of creating a block: … … 812 812 </pre> 813 813 814 <h4>Blocks vs. Methods</h4>815 816 This is sometimes a source of confusion so it's worth explaining in detail. Both methods and blocks create an object to hold their locals when they are called. The difference is what the "proto" and "self" slots of that locals object are set to. In a method, those slots are set to the target of the message. In a block, they're set to the locals object where the block was created. So a failed variable lookup in a block's locals continue in the locals where it was created. And a failed variable lookup in a method's locals continue in the object to which the message that activated it was sent.814 <h4>Blocks vs. メソッド</h4> 815 816 This is sometimes a source of confusion so it's worth explaining in detail. Both methods and blocks create an object to hold their locals when they are called. 違いは、ローカル領域のオブジェクト "proto" と "self" に何がセットされるかです。 メソッドでは、それらのスロットには、メッセージのターゲットがセットされる。 ブロックでは、そのブロックが作り出されたときのローカル領域オブジェクトがセットされる。 従ってブロック中では、ローカル領域にない変数は、そのブロックが作成されたときのローカル領域を辿って検索される。 そしてメソッド中では、ローカル領域にない変数は、そのメソッドを呼び出したオブジェクトを辿って検索される。 817 817 818 818 <h4>call and self slots</h4> … … 866 866 </table> 867 867 868 <h4> Variable Arguments</h4>868 <h4>可変長引数</h4> 869 869 870 870 The "call message" slot in locals can be used to access the unevaluated argument messages. Example of implementing if() within Io: … … 895 895 896 896 <a name="Objects-Forward"></a> 897 <h3> Forward</h3>897 <h3>転送</h3> 898 898 899 899 If an object doesn't respond to a message, it will invoke its "forward" method if it has one. Here's an example of how to print the information related lookup that failed: … … 949 949 950 950 <a name="Objects-Introspection"></a> 951 <h3> Introspection</h3>951 <h3>イントロスペクション</h3> 952 952 953 953 Using the following methods you can introspect the entire Io namespace. There are also methods for modifying any and all of these attributes at runtime. … … 997 997 998 998 </div> 999 <h2> Control Flow<a name="Control-Flow"></a></h2>999 <h2>制御構造<a name="Control-Flow"></a></h2> 1000 1000 <div class=indent> 1001 1001
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)