- Timestamp:
- 07/08/08 14:42:15 (5 months ago)
- Location:
- docs/nowelium
- Files:
-
- 3 modified
-
en_ja.corpus (modified) (previous)
-
ioDocs/IoGuide_ja.alair (modified) (previous)
-
ioDocs/IoGuide_ja.html (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/nowelium/ioDocs/IoGuide_ja.html
r15432 r15479 66 66 <div class=indexItem><a href="#Concurrency-Futures">Future</a></div> 67 67 <div class=indexItem><a href="#Concurrency-Yield">Yield</a></div> 68 <div class=indexItem><a href="#Concurrency-Pause andResume">一時停止と再開</a></div>68 <div class=indexItem><a href="#Concurrency-Pause-and-Resume">一時停止と再開</a></div> 69 69 70 70 <div class=indexSection><a href="#Exceptions">例外</a></div> … … 748 748 <h3>継承</h3> 749 749 750 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. 751 <p> 752 Since there are no classes, there's no difference between a subclass and an instance. Here's an example of creating a the equivalent of a subclass: 750 あるオブジェクトが該当するスロットを探すようなメッセージを受けた場合、見つからなければ、その1階層深い proto へ再帰的に検査を続けます。 検査のループが見つかった場合には、検査は中断されます。 マッチするスロットに実行可能なオブジェクトがあれば、例えば Block や CFunction などの場合、それが実行され、値があればその値を返します。 Io にはグローバルオブジェクトはなく、Lobby という Io 名前空間のルートオブジェクトがあります。 751 <p> 752 クラスがないため、サブクラスとインスタンスの違いはありません。 以下は、サブクラスに相当するものを作成する例です: 753 753 754 754 <pre> … … 757 757 </pre> 758 758 759 The above code sets the Lobby slot "Dog" to a clone of the Object object. Notice it only contains a protos list contains a reference to Object. Dog is now essentially a subclass of Object. Instance variables and methods are inherited from the proto. If a slot is set, it creates a new slot in our object instead of changing the proto: 759 上記のコードでは、Lobby の "Dog" スロットに Object オブジェクトのクローンをセットしています。 そのクローンは Object への参照を含む protos リストのみを持っています。 これで、本質的に Dog は Object のサブクラスとなります。 インスタンスの変数やメソッドはその proto から継承されます。 スロットがセットされた場合、proto は変更されず、作成したオブジェクトに新しいスロットを作成します: 760 760 761 761 <pre> … … 768 768 <h4>多重継承</h4> 769 769 770 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. 770 あるオブジェクトのprotosリストには、protoを幾つでも追加できます。 メッセージへの応答の際、検査構造は1層目の proto チェーンから検査します。 771 771 772 772 <a name="Objects-Methods"></a> 773 773 <h3>メソッド</h3> 774 774 775 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.例:775 メソッドは、呼び出された際、生成された際のオブジェクトをローカルに保存し、そのローカルの proto ポインタとそれ自身のスロットをターゲットにメッセージをセットする匿名の関数です。 Object メソッド method() でメソッドを作成することができます。 例: 776 776 777 777 <pre> … … 786 786 </pre> 787 787 788 The above code creates a new "subclass" of object named Dog and adds a bark slot containing a block that prints "woof!".メソッドを呼び出す例:788 上記コードは、Dog と名の付けられたオブジェクトの "サブクラス" を新たに作成し、"woof!" を出力するブロックである bark スロットを含んでいます。 メソッドを呼び出す例: 789 789 790 790 <pre> … … 792 792 </pre> 793 793 794 The default return value of a block is the result of the last expression. 794 ブロックのデフォルトの戻り値は、最後の式の結果になります。 795 795 796 796 <h4>引数</h4> … … 1288 1288 An object will automatically yield between processing each of its asynchronous messages. The yield method only needs to be called if a yield is required during an asynchronous message execution. 1289 1289 1290 <a name="Concurrency-Pause-and-Resume"></a> 1290 1291 <h4>一時停止と再開</h4> 1291 1292
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)