Skip to content

Commit 9733517

Browse files
[infra] Explain literal syntax in terms of code points whatwg/infra@7b152d4
1 parent 514422c commit 9733517

1 file changed

Lines changed: 59 additions & 35 deletions

File tree

infra-ja.html

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@
123123

124124
●●options
125125

126-
spec_date:2026-05-08
127-
trans_update:2025-05-17
126+
spec_date:2026-06-16
127+
trans_update:2025-06-17
128128
source_checked:251124
129129
spec_status:LS
130130
original_url:https://infra.spec.whatwg.org/
@@ -579,9 +579,11 @@
579579
具現化形:rendered form:~
580580
表記法:notation:~
581581
表記:say/denote/...
582-
括って:surrounding
583582
指示書き:instruction:~
584583
位置的:positional:~
584+
585+
括る:surrounding
586+
括る:starting with ending with
585587
余分な:extra
586588
少し短い:slightly shorter
587589
より短い:shorter
@@ -1054,7 +1056,7 @@
10541056

10551057
Commits:
10561058
<a href="https://github.com/whatwg/infra/commits">GitHub whatwg/infra/commits</a>
1057-
<a href="https://infra.spec.whatwg.org/commit-snapshots/97e62b3ec7cfee4cfae8c3e79bb9f3bf8aa0e0fc/" id="commit-snapshot-link">Snapshot as of this commit</a>
1059+
<a href="https://infra.spec.whatwg.org/commit-snapshots/7b152d4d4e3d3bf69cbbf6223b9fa4b2d1cad30a/" id="commit-snapshot-link">Snapshot as of this commit</a>
10581060
<a href="https://twitter.com/infrastandard">@infrastandard</a>
10591061

10601062
Tests:
@@ -2603,11 +2605,12 @@ <h3 title="Variables">3.5. 変数</h3>
26032605
<p>
26042606
`~tuple$を成す`~item$sctたちを複数個の変数に一括してアテガう構文も利用できる
26052607
— そのためには、
2606-
各~変数を~commaで分離した上で,全体を丸括弧で括る。
2608+
変数どうしを `002C^U `,^smb で分離した上で,
2609+
全体を文字 `0028^U `(^smb と `0029^U `)^smb で括る。
26072610
ただし、
26082611
変数の個数は,`~tuple$を成す`~item$sctの個数と相違し得ない。
26092612
2610-
A multiple assignment syntax can be used to assign multiple variables to the tuple’s items, by surrounding the variable names with parenthesis and separating each variable name by a comma. The number of variables assigned cannot differ from the number of items in the tuple.
2613+
A multiple assignment syntax can be used to assign multiple variables to the tuple’s items, by surrounding the variable names with U+0028 LEFT PARENTHESIS and U+0029 RIGHT PARENTHESIS, and separating each variable name with U+002C (,). The number of variables assigned cannot differ from the number of items in the tuple.
26112614
</p>
26122615

26132616
<div class="example">
@@ -5966,20 +5969,26 @@ <h3 title="Lists">5.1. ~list</h3>
59665969
簡便な表記法として、
59675970
`~list$を~literalで表出するための構文も利用できる
59685971
— そのためには、
5969-
各`~item$を~commaで分離した上で,全体を文字 «, » で括る。
5972+
`~item$どうしを `002C^U `,^smb で分離した上で,
5973+
全体を文字 `00AB^U `«^smb と `00BB^U `»^smb で括る。
5974+
5975+
For notational convenience, a literal syntax can be used to express lists, by surrounding the list with U+00AB («) and U+00BB (»), and separating its items with U+002C (,).\
5976+
</p>
5977+
5978+
<p>
59705979
~list用の~indexing構文も利用できる
59715980
— そのためには、
59725981
角括弧( [, ] )の内側に 0 番から数える~indexを供する。
59735982
~indexは,`存在-$について~~述べる場合を除いて,~~範囲を超えられない。
59745983
5975-
For notational convenience, a literal syntax can be used to express lists, by surrounding the list by « » characters and separating its items with a comma. An indexing syntax can be used by providing a zero-based index into a list inside square brackets. The index cannot be out-of-bounds, except when used with exists.
5984+
An indexing syntax can be used by providing a zero-based index into a list inside square brackets. The index cannot be out-of-bounds, except when used with exists.
59765985
</p>
59775986

59785987
<p class="example" id="example-list-notation">
59795988
%例 として`~list$
59805989
« `a^l, `b^l, `c^l, `a^l »
59815990
が与えられた下では、
5982-
%例[1] は `文字列$ `b^l を表す。
5991+
%例[ 1 ] は `文字列$ `b^l を表す。
59835992
59845993
Let example be the list « "a", "b", "c", "a" ». Then example[1] is the string "b".
59855994
</p>
@@ -6001,13 +6010,14 @@ <h3 title="Lists">5.1. ~list</h3>
60016010
簡便な表記法として、
60026011
`~list$ %~list を成す`~item$たちを複数個の変数に一括してアテガう構文を利用してもヨイ
60036012
— そのためには、
6004-
各~変数を~commaで分離した上で,全体を文字 «, » で括る。
6013+
変数~名どうしを `002C^U `,^smb で分離した上で,
6014+
全体を文字 `00AB^U `«^smb と `00BB^U `»^smb で括る。
60056015
%~list の`~size$は、
60066016
アテガわれる変数の個数と同じでなければナラナイ。
60076017
各 %n ~IN { 1 〜 %~list の`~size$ } に対し,
60086018
%n 個目の変数は %~list[ %n ~MINUS 1 ] に設定される。
60096019
6010-
For notational convenience, a multiple assignment syntax may be used to assign multiple variables to the list’s items, by surrounding the variables to be assigned by « » characters and separating each variable name with a comma. The list’s size must be the same as the number of variables to be assigned. Each variable given is then set to the value of the list’s item at the corresponding index.
6020+
For notational convenience, a multiple assignment syntax may be used to assign multiple variables to the list’s items, by surrounding the variables to be assigned with U+00AB («) and U+00BB (») (same as lists), and separating each variable name with U+002C (,). The list’s size must be the same as the number of variables to be assigned. Each variable given is then set to the value of the list’s item at the corresponding index.
60116021
</p>
60126022

60136023
<div class="example">
@@ -6292,9 +6302,13 @@ <h3 title="Lists">5.1. ~list</h3>
62926302
</p>
62936303

62946304
<p class="trans-note">
6295-
これがきちんと定義されるためには、
6296-
当の~listを成し得る~itemどうしの同等性が定義される必要がある
6297-
(したがって, %~list は %~item を包含し得るものと定義される必要もある)。
6305+
この条件 “現れる” がきちんと定義されるためには、[
6306+
%~list は~itemとして何を受容するか
6307+
]および[
6308+
それらの~itemどうしの同等性
6309+
]が定義される必要がある
6310+
— ほとんどの事例では、
6311+
これらがどう定義されるかは, %~list を利用している文脈から暗黙的に判明するが。
62986312
</p>
62996313

63006314
<p>
@@ -6764,7 +6778,7 @@ <h4 title="Stacks">5.1.1. ~stack</h4>
67646778
<p>
67656779
`~list$は,
67666780
`~stack@
6767-
( `stack^en )であると指名されることもある
6781+
( `stack^en )であるものとして指名されることもある
67686782
~stackは`~list$であるが、[
67696783
`付加する$ / `前付加する$ / `除去する$
67706784
]を利用する代わりに,以下に定義する句を利用して演算するのが慣例である。
@@ -6884,9 +6898,9 @@ <h4 title="Queues">5.1.2. ~queue</h4>
68846898
<p>
68856899
`~list$は
68866900
`~queue@
6887-
( `queue^en, ~~待ち~~行列)であると指名されることもある
6901+
( `queue^en, ~~待ち~~行列)であるものとして指名されることもある
68886902
~queueは`~list$であるが、[
6889-
`付加する$`前付加する$`除去する$
6903+
`付加する$`前付加する$`除去する$
68906904
]を利用する代わりに,以下に定義する句を利用して演算するのが慣例である。
68916905
68926906
Some lists are designated as queues. A queue is a list, but conventionally, the following operations are used to operate on it, instead of using append, prepend, or remove.
@@ -6972,7 +6986,7 @@ <h4 title="Sets">5.1.3. 集合</h4>
69726986
<p>
69736987
`~list$は
69746988
`有順序~集合@
6975-
( `ordered set^en )であると指名されることもある
6989+
( `ordered set^en )であるものとして指名されることもある
69766990
有順序~集合は、
69776991
`~list$であって,かつ[
69786992
同じ`~item$が重ねて現れてはナラナイとする,追加的な意味論
@@ -6982,8 +6996,11 @@ <h4 title="Sets">5.1.3. 集合</h4>
69826996
</p>
69836997

69846998
<p class="trans-note">
6985-
したがって,集合としてきちんと定義されるためには、
6986-
集合を成し得る~itemどうしの同等性(同値関係)が定義される必要がある。
6999+
したがって,集合としてきちんと定義されるためには、[
7000+
当の集合は~itemとして何を受容するか
7001+
]および[
7002+
それらの~itemどうしの同等性(同値関係)
7003+
]が定義される必要がある。
69877004
これは,[
69887005
~primitive値(文字列など)どうし/
69897006
~objどうし
@@ -6994,8 +7011,7 @@ <h4 title="Sets">5.1.3. 集合</h4>
69947011
`~list$や`有順序~map$は,~objとして扱われるのが慣例だが、
69957012
例えば`構造体$どうしの同等性は,明示的に定義されていないことが多い
69967013
【!https://github.com/whatwg/infra/issues/326】
6997-
— 多くの事例では、
6998-
成分ごとの比較に基づくものと推定されるが)。
7014+
— 成分ごとの比較に基づくものと推定される事例が多いが)。
69997015
</p>
70007016

70017017
<p class="note">注記:
@@ -7407,8 +7423,11 @@ <h3 title="Maps">5.2. ~map</h3>
74077423
]を表すことになる。
74087424
】【~FN3
74097425
~keyとして`構造体$なども利用され得る
7410-
— この条件がきちんと定義されるためには、
7411-
当の~mapを成し得る~entryたちの~keyどうしの同等性が定義される必要がある。
7426+
— この条件がきちんと定義されるためには、[
7427+
当の~mapを成す~entryたちは~keyとして何を受容するか
7428+
]および[
7429+
それらの~keyどうしの同等性
7430+
]が定義される必要がある。
74127431
】【
74137432
~IDL[
74147433
`辞書~型$/`~record型$
@@ -7427,19 +7446,24 @@ <h3 title="Maps">5.2. ~map</h3>
74277446
<p>
74287447
`有順序~map$を~literalで表出するための構文も利用できる
74297448
— そのためには、
7430-
各 `~entry$を
7431-
"%~key → %値"
7432-
の~~形で記して,
7433-
各~entryを~commaで分離した上で,
7434-
全体を文字 «[, ]» で括る。
7449+
各`~entry$を成す`~key$mapと`値$mapを `2192^U `→^smb で分離して,
7450+
`~entry$どうしを `002C^U `,^smb で分離した上で,
7451+
全体を文字~並び[
7452+
`00AB^U `«^smb, `005B^U `[^smb
7453+
]と[
7454+
`005D^U `]^smb, `00BB^U `»^smb
7455+
]で括る。
74357456
7436-
A literal syntax can be used to express ordered maps, by surrounding the ordered map with «[ ]» characters, denoting each of its entries as key → value, and separating its entries with a comma.
7457+
A literal syntax can be used to express ordered maps, by starting an ordered map with U+00AB («) and U+005B ([), ending it with U+005D (]) and U+00BB (»), separating each entry’s key and value with U+2192 (→), and separating its entries with U+002C (,).
7458+
7459+
by surrounding the ordered map with «[ ]» characters, denoting each of its entries as key → value, and separating its entries with a comma.
74377460
</p>
74387461

74397462
<p class="example" id="example-map-notation">
7440-
%~map ~EQ `有順序~map$ «[ `a^l → `x^bl, `b^l → `y^bl ]»
7441-
が与えられた下では、
7442-
%~map[ `a^l ] の結果は `~byte列$ `x^bl になる。
7463+
`有順序~map$ %~map として
7464+
«[ `a^l → `x^bl, `b^l → `y^bl ]»
7465+
が与えられたなら、
7466+
%~map[ `a^l ] は`~byte列$ `x^bl になる。
74437467
74447468
Let example be the ordered map «[ "a" → `x`, "b" → `y` ]». Then example["a"] is the byte sequence `x`.
74457469
</p>
@@ -7929,7 +7953,7 @@ <h4 title="Tuples">5.3.1. ~tuple</h4>
79297953
簡便な表記法として、
79307954
`~tuple$を~literalで表出するための構文も利用できる
79317955
— そのためには、
7932-
各`~item$sctを~commaで分離した上で, 全体を丸括弧で括る。
7956+
各`~item$sctを `002C^U `,^smb で分離した上で, 全体を丸括弧で括る。
79337957
この表記法を利用するときは、
79347958
各`名前$sctが何であるか【どの~tuple定義に属するのか】が,文脈から明瞭になる必要がある。
79357959
これは、
@@ -7939,7 +7963,7 @@ <h4 title="Tuples">5.3.1. ~tuple</h4>
79397963
角括弧( [, ] )の内側に 0 番から数える~indexを供する。
79407964
~indexは,~~範囲を超えられない。
79417965
7942-
A tuple is a struct whose items are ordered. For notational convenience, a literal syntax can be used to express tuples, by surrounding the tuple with parenthesis and separating its items with a comma. To use this notation, the names need to be clear from context. This can be done by preceding the first instance with the name given to the tuple. An indexing syntax can be used by providing a zero-based index into a tuple inside square brackets. The index cannot be out-of-bounds.
7966+
A tuple is a struct whose items are ordered. For notational convenience, a literal syntax can be used to express tuples, by surrounding the tuple with parentheses and separating its items with U+002C (,). To use this notation, the names need to be clear from context. This can be done by preceding the first instance with the name given to the tuple. An indexing syntax can be used by providing a zero-based index into a tuple inside square brackets. The index cannot be out-of-bounds.
79437967
</p>
79447968

79457969
<div class="example" id="example-tuple">

0 commit comments

Comments
 (0)