-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintroduction-ja.tex
605 lines (576 loc) · 35.4 KB
/
introduction-ja.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
% +++
% sequence = ["latex", "dvipdf"]
% latex = "uplatex"
% clean_files = [
% "%B.aux", "%B.dvi", "%B.glo", "%B.hd", "%B.idx", "%B.ind",
% "%B.ilg", "%B.log", "%B.out", "%B.synctex.gz",
% ]
% +++
\documentclass[uplatex,dvipdfmx,full,kernel]{wtpl3doc}
\usepackage{interface3-ja}
\begin{document}
%\title{Introduction to \pkg{expl3} and this document}
\title{\pkg{expl3}および本ドキュメントのイントロダクション}
%\author{%
% The \LaTeX3 Project\thanks
% {%
% E-mail:
% \href{mailto:latex-team@latex-project.org}
% {latex-team@latex-project.org}%
% }%
%}
\author{%
\LaTeX3プロジェクト\thanks
{%
E-mail:
\href{mailto:latex-team@latex-project.org}
{latex-team@latex-project.org}%
}%
}
%\date{Released 2020-01-22}
\date{バージョン 2020-01-22}
\maketitle
%This document is intended to act as a comprehensive reference manual
%for the \pkg{expl3} language. A general guide to the \LaTeX3
%programming language is found in \href{expl3.pdf}{expl3.pdf}.
このドキュメントは\pkg{expl3}言語の網羅的なリファレンスマニュアルとして
作成されたものです.\LaTeX3プログラミング言語の一般的な概説については
\href{expl3.pdf}{expl3.pdf}を参照してください.
%\section{Naming functions and variables}
\section{関数と変数の名前}
%\LaTeX3 does not use \texttt{@} as a \enquote{letter} for defining
%internal macros. Instead, the symbols |_| and \texttt{:}
%are used in internal macro names to provide structure. The name of
%each \emph{function} is divided into logical units using \texttt{_},
%while \texttt{:} separates the \emph{name} of the function from the
%\emph{argument specifier} (\enquote{arg-spec}). This describes the arguments
%expected by the function. In most cases, each argument is represented
%by a single letter. The complete list of arg-spec letters for a function
%is referred to as the \emph{signature} of the function.
\LaTeX3では\code{@}を内部マクロ定義のための\enquote{letter}として使用
しません.代わりに\code{_}と\code{:}が内部マクロに構造を持たせる目的で
使用されます.各関数の名前は\code{_}によって論理的な単位ごとに区切られ,
さらに\code{:}によって関数の\emph{名前}と\emph{引数指定子}
(\enquote{arg-spec}) に分けられます.引数指定子は,その関数が取る引数
の形を表すものです.ほとんどの場合,1つの引数は1文字の引数指定子に
よって表現されます.ある関数が取る引数の数だけ引数指定子を並べた文字列
は,その関数の\emph{シグネチャ}と見なすことができます.
%Each function name starts with the \emph{module} to which it belongs.
%Thus apart from a small number of very basic functions, all \pkg{expl3}
%function names contain at least one underscore to divide the module
%name from the descriptive name of the function. For example, all
%functions concerned with comma lists are in module \texttt{clist} and
%begin |\clist_|.
各関数の名前は,その関数が属する\emph{モジュール}名から始まります.
したがって,少数のごく基本的な関数を除き,すべての\pkg{expl3}関数名
にはモジュール名の部分を関数の説明的な名前と分離するためのアンダー
スコアが少なくとも1つ含まれています.例えば,カンマ区切りリストを扱う
すべての関数は\code{clist}モジュールに含まれていて,それらの名前は必ず
|\clist_|で始まります.
%Every function must include an argument specifier. For functions which
%take no arguments, this will be blank and the function name will end
%\texttt{:}. Most functions take one or more arguments, and use the
%following argument specifiers:
すべての関数名には引数指定子が含まれていなければなりません.引数を
取らない関数については,引数指定子の部分は空文字列となり,その関数名は
\code{:}で終わることになります.多くの関数は1つ以上の引数を取り,以下の
引数指定子を使用することになります:
%
\begin{description}[style=multiline, leftmargin=3zw]
% \item[\texttt{N} and \texttt{n}] These mean \emph{no manipulation},
% of a single token for \texttt{N} and of a set of tokens given in
% braces for \texttt{n}. Both pass the argument through exactly as
% given. Usually, if you use a single token for an \texttt{n} argument,
% all will be well.
\item[\code{N}/\code{n}] これらは\emph{操作なし} (no manipulation)
を意味します.\code{N}は単一トークン,\code{n}はブレースで囲われた
トークン列です.いずれの引数も関数にそのまま渡されることになります.
通常,\code{n}タイプの引数に単一トークンを与えたとしても,特に問題
は起こりません.
%
% \item[\texttt{c}] This means \emph{csname}, and indicates that the
% argument will be turned into a csname before being used. So
% |\foo:c| |{ArgumentOne}| will act in the same way as |\foo:N|
% |\ArgumentOne|.
\item[\code{c}] これは\emph{制御綴名} (csname) の意味で,このタイプの
引数は使用される前に制御綴名に変換されることを示しています.つまり
|\foo:c {ArgumentOne}|は|\foo:N \ArgumentOne|とまったく同じ挙動を
することになります.
%
% \item[\texttt{V} and \texttt{v}] These mean \emph{value
% of variable}. The \texttt{V} and \texttt{v} specifiers are used to
% get the content of a variable without needing to worry about the
% underlying \TeX{} structure containing the data. A \texttt{V}
% argument will be a single token (similar to \texttt{N}), for example
% |\foo:V| |\MyVariable|; on the other hand, using \texttt{v} a
% csname is constructed first, and then the value is recovered, for
% example |\foo:v| |{MyVariable}|.
\item[\code{V}/\code{v}] これらは\emph{変数の値} (value of variable)
を意味しています.この2つの指定子は,ある変数がもつ値を,その実装に
用いられている\TeX レベルの構造を考慮することなく取得するためのもの
です.\code{V}タイプの引数は(\code{N}と同様の)単一トークンです.
|\foo:V \MyVariable|のように使用します.一方で\code{v}を使用した
場合は,まず制御綴に変換され,その上で変数の値が取り出されます.
具体的には|\foo:v {MyVariable}|のように使用します.
%
% \item[\texttt{o}] This means \emph{expansion once}. In general, the
% \texttt{V} and \texttt{v} specifiers are favoured over \texttt{o}
% for recovering stored information. However, \texttt{o} is useful
% for correctly processing information with delimited arguments.
\item[\code{o}] これは\emph{一回展開} (expand once) を意味します.
一般には変数に格納されている情報を取り出す際には\code{V}/\code{v}を
用いる方が好ましいです.しかし\code{o}はデリミタ区切りの引数を正しく
処理する際に有用です.
%
% \item[\texttt{x}] The \texttt{x} specifier stands for \emph{exhaustive
% expansion}: every token in the argument is fully expanded until only
% unexpandable ones remain. The \TeX{} \tn{edef} primitive carries out
% this type of expansion. Functions which feature an \texttt{x}-type
% argument are \emph{not} expandable.
\item[\code{x}] これは\emph{完全展開} (exhaustive expansion) を意味して
います.このタイプの引数に含まれるすべてのトークンは展開不能なもののみ
が残る状態まで徹底的に展開されます.この動作は\TeX の\tn{edef}プリミ
ティブによって実現されています.\code{x}タイプの引数をとる関数は展開
可能では\emph{ありません}.
%
% \item[\texttt{e}] The \texttt{e} specifier is in many respects
% identical to \texttt{x}, but with a very different implementation.
% Functions which feature an \texttt{e}-type argument may be
% expandable. The drawback is that \texttt{e} is extremely slow
% (often more than $200$ times slower) in older engines, more
% precisely in non-\LuaTeX{} engines older than 2019.
\item[\code{e}] これはさまざまな点で\code{x}と同様ですが,それぞれの
実装は大きく異なっています.このタイプの引数をもつ関数は完全展開
可能たり得ます.タイプ\code{e}の欠点は古い\TeX 処理系(具体的には
2019年以前の\LuaTeX 以外の処理系)では処理が極めて低速(200倍以上
遅いことが多いです)であることです.
%
% \item[\texttt{f}] The \texttt{f} specifier stands for \emph{full
% expansion}, and in contrast to \texttt{x} stops at the first
% non-expandable token (reading the argument from left to right) without
% trying to expand it. If this token is a \meta{space token}, it is gobbled,
% and thus won't be part of the resulting argument. For example, when
% setting a token list variable (a macro used for storage), the sequence
\item[\code{f}] これは\emph{先頭完全展開} (full expansion) を意味して
います.\code{x}の場合と異なり,(引数を左から右に読んでいき)最初の
展開不能トークンが現れたところで展開が停止します.もし最初の展開不能
トークンが\meta{space token}であった場合は,そのトークンは取り除かれ
最終的な引数には残りません.例えば,トークンリスト変数(値の保存に
用いられるマクロ)を設定する
%
\begin{verbatim}
\tl_set:Nn \l_mya_tl { A }
\tl_set:Nn \l_myb_tl { B }
\tl_set:Nf \l_mya_tl { \l_mya_tl \l_myb_tl }
\end{verbatim}
%
% will leave |\l_mya_tl| with the content |A\l_myb_tl|, as |A| cannot
% be expanded and so terminates expansion before |\l_myb_tl| is considered.
というコードは|\l_mya_tl|の値を|A\l_myb_tl|に設定します.|A|は展開不能
トークンなので,|\l_myb_tl|を展開する前に展開処理が終了するためです.
%
% \item[\texttt{T} and \texttt{F}] For logic tests, there are the branch
% specifiers \texttt{T} (\emph{true}) and \texttt{F} (\emph{false}).
% Both specifiers treat the input in the same way as \texttt{n} (no
% change), but make the logic much easier to see.
\item[\code{T}/\code{F}] 論理テストのために,分岐指定子\code{T} (true)
と\code{F} (false) が用意されています.これらの指定子はその入力を
\code{n}と同様に扱います(つまり,何も変更しません)が,分岐処理を
かなり見やすくします.
%
% \item[\texttt{p}] The letter \texttt{p} indicates \TeX{}
% \emph{parameters}. Normally this will be used for delimited
% functions as \pkg{expl3} provides better methods for creating simple
% sequential arguments.
これは\TeX のパラメータ (parameters) を意味しています.通常この指定子は
デリミタ付き引数を取る関数定義に使用されますが,\pkg{expl3}にはシンプル
な関数に対してはより洗練された方法を提供しています.
%
% \item[\texttt{w}] Finally, there is the \texttt{w} specifier for
% \emph{weird} arguments. This covers everything else, but mainly
% applies to delimited values (where the argument must be terminated
% by some specified string).
\item[\code{w}] これは\emph{奇妙な} (weird) 引数のための指定子です.
これは上記の分類に当てはまらないすべての引数を表現するためのものです
が,主にデリミタ区切りにされる値(そうした引数は必ず特定の文字列で
終端が示される必要があります)を扱う際に採用されます.
%
% \item[\texttt{D}] The \texttt{D} specifier means \emph{do not use}.
% All of the \TeX{} primitives are initially \cs{let} to a \texttt{D}
% name, and some are then given a second name. Only the kernel
% team should use anything with a \texttt{D} specifier!
\item[\code{D}] これは\emph{使用不可} (do not use) を意味します.
すべての\TeX プリミティブは最初に引数指定子\code{D}をもつ名前に
\cs{let}代入され,一部にはさらに別の名称が与えられます.\LaTeX3の
カーネル開発者のみが\code{D}指定子をもつ関数を使用すべきです.
\end{description}
%
%Notice that the argument specifier describes how the argument is
%processed prior to being passed to the underlying function. For example,
%|\foo:c| will take its argument, convert it to a control sequence and
%pass it to |\foo:N|.
引数指定子は,それぞれの引数がその関数本体に渡される前にどう処理されるか
を示すものであるということに注意してください.例えば|\foo:c|は最初の引数
をとり,それを制御綴に変換したものを|\foo:N|に渡します.
%Variables are named in a similar manner to functions, but begin with
%a single letter to define the type of variable:
変数の命名規則も関数のそれと似ていますが,変数の種類を表す1文字から始まり
ます:
%
\begin{description}[style=multiline, leftmargin=3zw]
% \item[\texttt{c}] Constant: global parameters whose value should not
% be changed.
% \item[\texttt{g}] Parameters whose value should only be set globally.
% \item[\texttt{l}] Parameters whose value should only be set locally.
\item[\code{c}] 定数.グローバルで,値は変更されるべきでありません.
\item[\code{g}] グローバル変数.その値は必ずグローバルに設定されるべき
です.
\item[\code{l}] ローカル変数.その値は必ずローカルに設定されるべきです.
\end{description}
%
%Each variable name is then build up in a similar way to that of a
%function, typically starting with the module\footnote{The module names are
% not used in case of generic scratch registers defined in the data
% type modules, e.g., the
% \texttt{int} module contains some scratch variables called \cs{l_tmpa_int},
% \cs{l_tmpb_int}, and so on. In such a case adding the module name up front
% to denote the module
% and in the back to indicate the type, as in
% \texttt{\string\l_int_tmpa_int} would be very unreadable.} name
%and then a descriptive part.
%Variables end with a short identifier to show the variable type:
上記の種別の後続部は,各変数の名前は関数と似た構成をもちます.典型的には
まずモジュール名\footnote{モジュール名は各データ型モジュールにおいて汎用
目的で確保されているレジスタでは省略されています.例えば\code{int}モジュール
には\cs{l_tmpa_int}, \cs{l_tmpb_int}という汎用の一時変数が含まれています.
このような変数については,先頭にモジュール名・末尾にデータ型をおいてしまうと
\code{\string\l_int_tmpa_int}のように極めて不格好な名前になってしまいます}が
おかれ,続いて説明的な名前がおかれます.変数名の末尾にはデータ型を表す短い
識別子がおかれます:
%
\begin{description}[style=multiline, leftmargin=5zw]
% \item[\texttt{clist}] Comma separated list.
% \item[\texttt{dim}] \enquote{Rigid} lengths.
% \item[\texttt{fp}] Floating-point values;
% \item[\texttt{int}] Integer-valued count register.
% \item[\texttt{muskip}] \enquote{Rubber} lengths for use in
% mathematics.
% \item[\texttt{seq}] \enquote{Sequence}: a data-type used to implement
% lists (with access at both ends) and stacks.
% \item[\texttt{skip}] \enquote{Rubber} lengths.
% \item[\texttt{str}] String variables: contain character data.
% \item[\texttt{tl}] Token list variables: placeholder for a token list.
\item[\code{clist}] カンマ区切りリスト
\item[\code{dim}] 寸法 (\enquote{rigid} length)
\item[\code{fp}] 浮動小数点数
\item[\code{int}] 整数カウンタレジスタ
\item[\code{muskip}] 数式用スキップ (\enquote{rubber} length)
\item[\code{seq}] \emph{シークエンス}:両端からアクセス可能なリストと
スタックを実装するのに用いられるデータ構造
\item[\code{skip}] スキップ (\enquote{rubber} length)
\item[\code{str}] 文字列変数:文字データを含むもの
\item[\code{tl}] トークンリスト変数:トークンリストを格納するもの
\end{description}
%
%Applying \texttt{V}-type or \texttt{v}-type expansion to variables of
%one of the above types is supported, while it is not supported for the
%following variable types:
上記のデータ型の変数については\code{V}タイプおよび\code{v}タイプの展開が
サポートされていますが,以下のデータ型についてはサポートされていません:
%
\begin{description}[style=multiline, leftmargin=5zw]
% \item[\texttt{bool}] Either true or false.
% \item[\texttt{box}] Box register.
% \item[\texttt{coffin}] A \enquote{box with handles} --- a higher-level
% data type for carrying out \texttt{box} alignment operations.
% \item[\texttt{flag}] Integer that can be incremented expandably.
% \item[\texttt{fparray}] Fixed-size array of floating point values.
% \item[\texttt{intarray}] Fixed-size array of integers.
% \item[\texttt{ior}/\texttt{iow}] An input or output stream, for
% reading from or writing to, respectively.
% \item[\texttt{prop}] Property list: analogue of dictionary or
% associative arrays in other languages.
% \item[\texttt{regex}] Regular expression.
\item[\code{bool}] 真 (true) または偽 (false)
\item[\code{box}] ボックスレジスタ
\item[\code{coffin}] 高機能ボックス:ボックス配列操作のための高級なデータ
構造
\item[\code{flag}] 展開限定文脈でインクリメント可能な整数
\item[\code{fparray}] 浮動小数点数用の静的配列
\item[\code{intarray}] 整数用の静的配列
\item[\code{ior}/\code{iow}] 入出力ストリーム
\item[\code{prop}] プロパティリスト:他言語の辞書や連想配列に相当
\item[\code{regex}] 正規表現
\end{description}
%\subsection{Terminological inexactitude}
\subsection{言語的不正確 (terminological inexactitude)}
%A word of warning. In this document, and others referring to the \pkg{expl3}
%programming modules, we often refer to \enquote{variables} and
%\enquote{functions} as if they
%were actual constructs from a real programming language. In truth, \TeX{}
%is a macro processor, and functions are simply macros that may or may not take
%arguments and expand to their replacement text. Many of the common variables
%are \emph{also} macros, and if placed into the input stream will simply expand
%to their definition as well~--- a \enquote{function} with no arguments and a
%\enquote{token list variable} are almost the same.\footnote{\TeX{}nically,
%functions with no arguments are \tn{long} while token list variables are not.}
%On the other
%hand, some \enquote{variables} are actually registers that must be
%initialised and their values set and retrieved with specific functions.
これは警告です.このドキュメント,およびその他の\pkg{expl3}プログラミング
モジュールについて述べる文書において,しばしば「変数」や「関数」という用語は
それらがあたかも真のプログラミング言語の構成要素であるかのように使用されます.
しかし実際には,\TeX はマクロ処理系であり,関数は時に引数をとり,また時に
引数をとらずにその置換テキストへと展開されます.多くの一般的なマクロも
\emph{やはり}マクロであり,入力ストリームに置かれた場合はその定義に従って
関数と同様に展開されることになります.つまり引数のない「関数」と「トークン
リスト変数」はほぼ同じものです\footnote{{\TeX}nicalには引数のない関数は
\tn{long}有効なマクロなのに対し,トークンリスト変数はそうではないという
違いはあります.}.一方で,いくつかの変数は一部の「変数」は実体がレジスタ
で,使用前には初期化が,その値の設定や取得には専用の関数が必要です.
%The conventions of the \pkg{expl3} code are designed to clearly separate the
%ideas of \enquote{macros that contain data} and
%\enquote{macros that contain code}, and a
%consistent wrapper is applied to all forms of \enquote{data} whether they be
%macros or
%actually registers. This means that sometimes we will use phrases like
%\enquote{the function returns a value}, when actually we just mean
%\enquote{the macro expands to something}. Similarly, the term
%\enquote{execute} might be used in place of \enquote{expand}
%or it might refer to the more specific case of
%\enquote{processing in \TeX's stomach}
%(if you are familiar with the \TeX{}book parlance).
\pkg{expl3}コードの習慣は「データを格納するためのマクロ」と「コードを含む
マクロ」を明確に区別し,あらゆる「データ」について,その実体がマクロであれ
レジスタであれ一貫したラッパををもつように設計されています.そのため時として
実際には単に「マクロが何かに展開される」ことを「関数が値を返す」というように
表現する場合があります.同様に「実行する」という表現は単に「展開」を意味して
いるか,あるいは特定のケースでは「\TeX のお腹で処理が行なわれる」(これは
『\TeX ブック』の用語に詳しい人向けの表現です)ということを意味しています.
%If in doubt, please ask; chances are we've been hasty in writing certain
%definitions and need to be told to tighten up our terminology.
もしこの方針を疑うならば,お知らせください.もしかすると,私たちはより厳密な
定義を書く下す余裕がないほどせっかちだったかもしれません.その場合,私たちの
用語を整理する必要があると指摘される必要があります.
%% !! この訳は自信がない !!
%\section{Documentation conventions}
\section{このドキュメントについて}
%This document is typeset with the experimental \pkg{l3doc} class;
%several conventions are used to help describe the features of the code.
%A number of conventions are used here to make the documentation clearer.
このドキュメントは実験的なクラス\pkg{l3doc}で作成されています.このクラス
ではコードの特徴を示すのにいくつかのルールがあります.そして,その多くが
説明をより明確にするために本ドキュメントでも用いられています.
%Each group of related functions is given in a box. For a function with
%a \enquote{user} name, this might read:
関連する関数はグループごとに1つのボックスに入れられます.「ユーザ」向け
の関数であれば,次のようになります:
%
\begin{function}[label = ]{\ExplSyntaxOn, \ExplSyntaxOff}
\begin{syntax}
|\ExplSyntaxOn| \dots{} |\ExplSyntaxOff|
\end{syntax}
% The textual description of how the function works would appear here. The
% syntax of the function is shown in mono-spaced text to the right of
% the box. In this example, the function takes no arguments and so the
% name of the function is simply reprinted.
当該の関数がどのように働くかについてのテキスト情報はここに記述されます.
関数のシンタックスはボックスの右側に等幅フォントで示されます.この例では
関数は引数を取らないので,単純に関数名が反復されるだけになっています.
\end{function}
%For programming functions, which use \texttt{_} and \texttt{:} in their name
%there are a few additional conventions: If two related functions are given
%with identical names but different argument specifiers, these are termed
%\emph{variants} of each other, and the latter functions are printed in grey to
%show this more clearly. They will carry out the same function but will take
%different types of argument:
名前に\code{_}と\code{:}を含むプログラミング関数については,もういくつかの
表記上のルールがあります.もし2つの関数が同一の名前をもち,引数指定子だけ
が異なる場合,これらは互いに\emph{変種}であるといい,変種であることをより
明確に表すために後に出てくる関数はグレーで表示されます.変種は同一の機能を
もっていますが,異なるタイプの引数を取ります:
%
\begin{function}[label = ]{\seq_new:N, \seq_new:c}
\begin{syntax}
|\seq_new:N| \meta{sequence}
\end{syntax}
% When a number of variants are described, the arguments are usually
% illustrated only for the base function. Here, \meta{sequence} indicates
% that |\seq_new:N| expects the name of a sequence. From the argument
% specifier, |\seq_new:c| also expects a sequence name, but as a
% name rather than as a control sequence. Each argument given in the
% illustration should be described in the following text.
複数の変種が同時に説明される場合,通常は基本となる関数1つについてのみ
シンタックスが表示されます.ここで\meta{sequence}は|\seq_new:N|が
シークエンス変数をとることを示しています.|\seq_new:c|もやはりシーク
エンス変数をとりますが,引数指定子から制御綴ではなく名前の形でとると
いうことがわかります.シンタックス表示に現れる各引数は,普通それに続く
テキストで説明されます.
\end{function}
%\paragraph{Fully expandable functions}
\paragraph{完全展開可能な関数}
%
%\hypertarget{expstar}{Some functions are fully expandable},
%which allows them to be used within
%an \texttt{x}-type or \texttt{e}-type argument (in plain \TeX{} terms, inside an \tn{edef} or \tn{expanded}),
%as well as within an \texttt{f}-type argument.
%These fully expandable functions are indicated in the documentation by
%a star:
\hypertarget{expstar}{一部の関数は完全展開可能です}.完全展開可能な関数
は\code{x}タイプや\code{e}タイプの引数(\TeX 言語の用語で言えば
\tn{edef}や\tn{expanded}の中)に加え,\code{f}タイプの引数の中でも使用
することができます.このような完全展開可能な関数は,このドキュメントでは
星印(アスタリスク)で明示されます:
%
\begin{function}[EXP, label = ]{\cs_to_str:N}
\begin{syntax}
|\cs_to_str:N| \meta{cs}
\end{syntax}
% As with other functions, some text should follow which explains how
% the function works. Usually, only the star will indicate that the
% function is expandable. In this case, the function expects a \meta{cs},
% shorthand for a \meta{control sequence}.
他の関数と同様,この位置には当該関数がどのように働くのかについて説明
されます.通常,その関数が展開可能であるかどうかは星印の有無によって
のみ表示されます.ところで,ここでの\meta{cs}は\meta{control
sequence}の短縮形です.
\end{function}
%\paragraph{Restricted expandable functions}
\paragraph{制限付き完全展開可能関数}
%
%\hypertarget{rexpstar}{A few functions are fully expandable} but cannot be fully expanded within
%an \texttt{f}-type argument. In this case a hollow star is used to indicate
%this:
\hypertarget{rexpstar}{ごく一部ですが},完全展開可能ではあるものの
\code{f}タイプの引数では完全展開されないものもあります.このような関数
には白抜きの星印が付けられます:
%
\begin{function}[rEXP, label = ]{\seq_map_function:NN}
\begin{syntax}
|\seq_map_function:NN| \meta{seq} \meta{function}
\end{syntax}
\end{function}
%\paragraph{Conditional functions}
\paragraph{条件分岐関数}
%
%\hypertarget{explTF}{Conditional (\texttt{if}) functions}
%are normally defined in three variants, with
%\texttt{T}, \texttt{F} and \texttt{TF} argument specifiers. This allows
%them to be used for different \enquote{true}/\enquote{false} branches,
%depending on
%which outcome the conditional is being used to test. To indicate this
%without repetition, this information is given in a shortened form:
\hypertarget{explTF}{条件分岐関数}(一般に\code{if}を含むもの)には通常
\code{T}, \code{F}, \code{TF}という3パターンの引数指定子をもつ変種が存在
します.これらの変種の存在によって,対象となる条件の真偽判定結果のどちら
か一方または両者を使いたいときにも対応することができます.この3パターンの
存在を繰り返しなく表現するため,次のような省略表記を用います:
%
\begin{function}[EXP,TF, label = ]{\sys_if_engine_xetex:}
\begin{syntax}
|\sys_if_engine_xetex:TF| \Arg{true code} \Arg{false code}
\end{syntax}
% The underlining and italic of \texttt{TF} indicates that three functions
% are available:
下線付きの斜体で表示されている\code{TF}は次の3つの関数が利用可能である
ことを示しています:
%
\begin{itemize}
\item |\sys_if_engine_xetex:T|
\item |\sys_if_engine_xetex:F|
\item |\sys_if_engine_xetex:TF|
\end{itemize}
%
% Usually, the illustration
% will use the \texttt{TF} variant, and so both \meta{true code}
% and \meta{false code} will be shown. The two variant forms \texttt{T} and
% \texttt{F} take only \meta{true code} and \meta{false code}, respectively.
% Here, the star also shows that this function is expandable.
% With some minor exceptions, \emph{all} conditional functions in the
% \pkg{expl3} modules should be defined in this way.
通常,シンタックス表示には\code{TF}変種が用いられ,したがって\meta{true
code}と\meta{false code}の両方が現れているはずです.引数指定子\code{T},
\code{F}をもつ変種は,それぞれ\meta{true code}と\meta{false code}のうち
一方だけを引数に取ります.また,この関数は星印が付いており完全展開可能
です.数少ない例外を除いては,\pkg{expl3}モジュールが提供する\emph{ほと
んどの}条件分岐関数は完全展開可能なように定義されています.
\end{function}
%Variables, constants and so on are described in a similar manner:
変数や定数も同様の方法で説明されます:
%
\begin{variable}[label = ]{\l_tmpa_tl}
% A short piece of text will describe the variable: there is no
% syntax illustration in this case.
一般に変数の説明は短く,シンタックス表示もありません.
\end{variable}
%In some cases, the function is similar to one in \LaTeXe{} or plain \TeX{}.
%In these cases, the text will include an extra \enquote{\textbf{\TeX{}hackers
%note}} section:
一部の関数はプリミティブや\LaTeXe やplain \TeX のマクロと類似しています.
そのような場合,解説におまけの\emph{\TeX 言語者向けノート}枠が付随します.
%
\begin{function}[EXP, label = ]{\token_to_str:N}
\begin{syntax}
|\token_to_str:N| \meta{token}
\end{syntax}
% The normal description text.
通常の解説テキスト.
%
\begin{texnote}
% Detail for the experienced \TeX{} or \LaTeXe\ programmer. In this
% case, it would point out that this function is the \TeX{} primitive
% |\string|.
\TeX 言語や\LaTeXe に精通した開発者向けの詳細はここに記述されます.
たとえば|\token_to_str:N|の場合,この関数は\TeX プリミティブの
|\string|であることが説明されます.
\end{texnote}
\end{function}
%\paragraph{Changes to behaviour}
\paragraph{変更履歴}
%
%When new functions are added to \pkg{expl3}, the date of first inclusion is
%given in the documentation. Where the documented behaviour of a function
%changes after it is first introduced, the date of the update will also be
%given. This means that the programmer can be sure that any release of
%\pkg{expl3} after the date given will contain the function of interest with
%expected behaviour as described. Note that changes to code internals, including
%bug fixes, are not recorded in this way \emph{unless} they impact on the
%expected behaviour.
\pkg{expl3}に新しい関数が追加される場合,その日付はドキュメントに明記されます.
また文書化されていた挙動が変更される場合は,その更新の日付も明示されます.
したがって,ドキュメントに記載の日付以降にリリースされた\pkg{expl3}であれば,
そこに記述された挙動をする関数が含まれていることは保証されます.ただしバグ
修正を含む内部実装の修正は,仕様たる挙動に影響しない限り,このような方法では
記録され\emph{ない}ことに注意してください.
%\section{Formal language conventions which apply generally}
\section{\pkg{expl3}言語における一般則}
%As this is a formal reference guide for \LaTeX3 programming, the descriptions
%of functions are intended to be reasonably \enquote{complete}. However, there
%is also a need to avoid repetition. Formal ideas which apply to general
%classes of function are therefore summarised here.
これは\LaTeX3プログラミングのための形式的なリファレンスガイドなので,関数の
解説は合理的に「完全」であることが意図されています.一方で,冗長な繰り返しは
避ける必要があります.そのため,シンタックスに関する基本的なアイデアをここに
まとめておくことにします.
%For tests which have a \texttt{TF} argument specification, the test if
%evaluated to give a logically \texttt{TRUE} or \texttt{FALSE} result.
%Depending on this result, either the \meta{true code} or the \meta{false code}
%will be left in the input stream. In the case where the test is expandable,
%and a predicate (|_p|) variant is available, the logical value determined by
%the test is left in the input stream: this will typically be part of a larger
%logical construct.
引数指定子\code{TF}をもつ条件分岐関数では,対象となる条件は論理的に
\code{TRUE}なのか\code{FALSE}なのかを評価されます.その評価結果に基づいて,
\meta{true code}または\meta{false code}のいずれかが入力ストリームに残されます.
展開可能な条件分岐については,述語変種 (|_p|, predicate) も提供されています.
この変種を用いた場合,条件分岐の結果を表す論理値が入力ストリームに残ります.
通常,これらはより大きな論理条件の中で用いられるものです.
%\section{\TeX{} concepts not supported by \LaTeX3{}}
\section{\LaTeX3でサポートされない\TeX 言語の概念}
%The \TeX{} concept of an \enquote{\cs{outer}} macro is \emph{not supported}
%at all by \LaTeX3{}. As such, the functions provided here may break when
%used on top of \LaTeXe{} if \cs{outer} tokens are used in the arguments.
\TeX 言語における\cs{outer}付きマクロは\LaTeX3ではまったく\emph{サポート
されません}.したがって,\pkg{expl3}の関数は\LaTeXe 上で\cs{outer}トークンが
引数に渡された場合には正しく動作しない可能性があります.
\end{document}