@@ -8892,15 +8892,14 @@ <h4 title="Overloading vs. union types">2.5.8.1. 多重定義 vs. 共用体~型<
88928892< h4 title ="Iterable declarations "> 2.5.9. 可反復~宣言</ h4 >
88938893
88948894< p >
8895- ~ifcは
8895+ `~ifc$は、
88968896`可反復@
8897- ( `iterable^en )になるように宣言できる。
8898- そのためには、
8899- `~ifc$の本体~内で
8897+ ( `iterable^en )になるよう宣言できる
8898+ — その本体~内で
89008899`可反復~宣言@
89018900( `iterable declaration^en )
89028901(`Iterable$g に合致-)
8903- を利用すること 。
8902+ を利用することにより 。
89048903◎
89058904An interface can be declared to be iterable by using an iterable declaration (matching Iterable) in the body of the interface.
89068905</ p >
@@ -8914,7 +8913,7 @@ <h4 title="Iterable declarations">2.5.9. 可反復~宣言</h4>
89148913
89158914< p >
89168915可反復として宣言された~ifcを実装している~objは、
8917- 値の連列を得するために反復できるようになる 。
8916+ 値たちが成す連列を得するよう反復することを~supportする 。
89188917◎
89198918Objects implementing an interface that is declared to be iterable support being iterated over to obtain a sequence of values.
89208919</ p >
@@ -8929,64 +8928,53 @@ <h4 title="Iterable declarations">2.5.9. 可反復~宣言</h4>
89298928</ p >
89308929
89318930< p >
8932- ~parameterに与えられた型の個数が:
8933- ◎
8934- ↓</ p >
8935-
8936- < ul >
8937- < li >
8938- 1 個ならば,~ifcは
8931+ ~parameterとして, 1 個の型が与えられた場合、
8932+ 当の~ifcは
89398933`値~反復子@
8940- ( `value iterator^en )を有することになる
8934+ ( `value iterator^en )を有する
89418935— それは、
89428936所与の型の値たちを供する。
89438937◎
89448938If a single type parameter is given, then the interface has a value iterator and provides values of the specified type.\
8945- </ li >
8946- < li >
8947- 2 個ならば,~ifcは
8939+ </ p >
8940+
8941+ < p >
8942+ ~parameterとして, 2 個の型が与えられた場合、
8943+ 当の~ifcは
89488944`~pair反復子@
8949- ( `pair iterator^en )を有することになる
8950- — それは、[
8951- 所与の
8952- ( ~key型, 値~型 )
8953- の値たちが成す`値~pair$
8954- ]たちを供する。
8945+ ( `pair iterator^en )を有する
8946+ — それは、
8947+ `値~pair$たちを供する。
89558948◎
89568949If two type parameters are given, then the interface has a pair iterator and provides value pairs with the given types.
8957- </ li >
8958- </ ul >
8950+ </ p >
89598951
89608952< p >
89618953各
89628954`値~pair@
89638955( `value pair^en )は、
8964- 2 つの `~item$sct
8956+ 2 個の `~item$sct
89658957( `~key$vP, `値$vP )
89668958からなる`構造体$である:
89678959◎
89688960A value pair, given a key type and a value type, is a struct with two items:
89698961</ p >
8970- < ol >
8962+ < ul >
89718963 < li >
89728964`~key@vP
8973- は、
8974- ~key型の~IDL値を値にとる,[
8975- `名前$sct ~EQ `key^l
8976- ]なる`~item$sctである
8965+ の`名前$sctは `key^l であり,
8966+ 1 個目の型の~IDL値を値にとる。
89778967◎
89788968an item whose name is "key", which is referred to as the value pair’s key, and whose value is an IDL value of the key type;
89798969</ li >
89808970 < li >
89818971`値@vP
8982- は、
8983- 値~型の~IDL値を値にとる,[
8984- `名前$sct ~EQ `value^l
8985- ]なる`~item$sctである
8972+ の`名前$sctは `value^l であり,
8973+ 2 個目の型の~IDL値を値にとる。
89868974◎
89878975an item whose name is "value", which is referred to as the value pair’s value, and whose value is an IDL value of the value type.
89888976</ li >
8989- </ ol >
8977+ </ ul >
89908978
89918979< p >
89928980`値~反復子$は、
@@ -9019,28 +9007,40 @@ <h4 title="Iterable declarations">2.5.9. 可反復~宣言</h4>
90199007
90209008< div class ="note ">
90219009< p > 注記:
9022- `値~反復子$に対し生成される~JS `forEach^jp ~methodは、
9023- `Array.prototype.forEach^c が行うように,その~callbackを呼出す。
9024- `~pair反復子$用の `forEach^jp ~methodは、
9025- `Map.prototype.forEach^c が行うように,その~callbackを呼出す。
9010+ [
9011+ `値~反復子$/`~pair反復子$
9012+ ]用に生成される~JS `forEach^jp ~methodは、[
9013+ `Array.prototype.forEach^c / `Map.prototype.forEach^c
9014+ ]が行う様に,その~callbackを呼出す。
90269015◎
90279016The JavaScript forEach method that is generated for a value iterator invokes its callback like Array.prototype.forEach does, and the forEach method for a pair iterator invokes its callback like Map.prototype.forEach does.
90289017</ p >
90299018
90309019< p >
9031- 現在,`値~反復子$は`有index~propを~support$する~ifcに限り許容されているので、
9032- `forEach^jp ~methodを配列のように利用することもイミを成す。
90339020`値~反復子$は、
9034- 次に該当する `forEach^jp ~methodにも必要になり得る
9035- ⇒#
9036- (a) `有index~propを~support$しない~ifc上のもの/
9037- (b) ~callbackを,代わりに `Set.prototype.forEach^c のように呼出すもの(ここでの~keyは、値と同じ)。
9021+ 現時点では,`有index~propを~support$する~ifcにしか許容されないので、
9022+ `Array^jt`-like^en な `forEach^jp ~methodを利用することもイミを成す。
9023+ 次のような`値~反復子$も必要になり得る:
90389024◎
9039- Since value iterators are currently allowed only on interfaces that support indexed properties, it makes sense to use an Array-like forEach method. There could be a need for value iterators (a) on interfaces that do not support indexed properties, or (b) with a forEach method that instead invokes its callback like Set.prototype.forEach (where the key is the same as the value). \
9025+ Since value iterators are currently allowed only on interfaces that support indexed properties, it makes sense to use an Array-like forEach method. There could be a need for value iterators\
90409026</ p >
9027+ < ul >
9028+ < li >
9029+ `有index~propを~support$しない~ifc上にあるもの
9030+ ◎
9031+ (a) on interfaces that do not support indexed properties,\
9032+ </ li >
9033+ < li >
9034+ ~callbackを代わりに `Set.prototype.forEach^c の様に呼出す `forEach^jp ~methodを伴うもの
9035+ (そこでの~keyは、
9036+ 値と同じになる)
9037+ ◎
9038+ or (b) with a forEach method that instead invokes its callback like Set.prototype.forEach (where the key is the same as the value).\
9039+ </ li >
9040+ </ ul >
90419041
90429042< p >
9043- そのような `forEach^jp ~methodを必要とする~APIを再~作成している策定者は 、
9043+ そのような `forEach^jp ~methodが必要になる~APIを作成している策定者は 、
90449044`Enhancement request for Iterables$fIされたし。
90459045◎
90469046If you’re creating an API that needs such a forEach method, please file an issue.
@@ -9049,7 +9049,7 @@ <h4 title="Iterable declarations">2.5.9. 可反復~宣言</h4>
90499049
90509050< p class ="note "> 注記:
90519051`配列~反復子~obj$は,このように働く。
9052- `有index~propを~support$する ~ifcに対しては 、[
9052+ `有index~propを~support$する ~ifc用には 、[
90539053`entries^jp / `keys^jp / `values^jp / `Symbol.iterator$jI
90549054]から返される反復子~objは,実際の`配列~反復子~obj$である。
90559055◎
0 commit comments