@@ -6,17 +6,17 @@ $(HEADERNAV_TOC)
6
6
7
7
$(H2 $(LNAME2 Background, Background))
8
8
9
- $(P Compile-time lists are an important metaprogramming concept that comes naturally
9
+ $(P Compile-time sequences are an important metaprogramming concept that comes naturally
10
10
from D support for $(LINK2 variadic-function-templates.html, variadic templates). They
11
- allow a programmer to operate on types, symbols and expressions , enabling the ability to define
12
- compile-time algorithms that operate on types, symbols and expressions .
11
+ allow a programmer to operate on types, symbols and values , enabling the ability to define
12
+ compile-time algorithms that operate on types, symbols and values .
13
13
)
14
14
15
- $(P $(B Note:) For historical reasons these lists can sometimes be called tuples in documentation or compiler
15
+ $(P $(B Note:) For historical reasons these sequences can sometimes be called tuples in documentation or compiler
16
16
internals, but don't get confused - they don't have much in common with tuples that
17
17
commonly exist in other languages. Sequences of values of different types that can be
18
18
returned from functions are provided by $(PHOBOS typecons, .Tuple, std.typecons.Tuple).
19
- Using term "tuple" to mean compile-time lists is discouraged to avoid confusion, and if encountered
19
+ Using term "tuple" to mean compile-time sequences is discouraged to avoid confusion, and if encountered
20
20
should result in a $(LINK2 https://issues.dlang.org, documentation bug report).
21
21
)
22
22
@@ -29,7 +29,7 @@ $(HEADERNAV_TOC)
29
29
$(P `T` here is a $(DDSUBLINK spec/template, variadic-templates, TemplateParameterSequence),
30
30
which is a core language feature. It has its own special semantics,
31
31
and, from the programmer's point of view, is most similar to an array of compile-time entities - types,
32
- symbols (names) and expressions ( values) . One can check the length of this list
32
+ symbols (names) and values. One can check the length of this sequence
33
33
and access any individual element:
34
34
)
35
35
@@ -49,7 +49,7 @@ $(HEADERNAV_TOC)
49
49
50
50
$(H2 $(LNAME2 AliasSeq, AliasSeq))
51
51
52
- $(P The language itself does not provide any means to define such lists outside of
52
+ $(P The language itself does not provide any means to define such sequences outside of
53
53
a template parameter declaration. Instead, there is a
54
54
$(MREF_ALTTEXT simple utility, std, meta) provided by the standard
55
55
library:
@@ -59,7 +59,7 @@ $(HEADERNAV_TOC)
59
59
alias AliasSeq(T...) = T;
60
60
---
61
61
62
- $(P All it does is give a specific variadic argument list an externally accessible name so
62
+ $(P All it does is give a specific variadic argument sequence an externally accessible name so
63
63
that it can be worked with in any other context:
64
64
)
65
65
@@ -69,7 +69,7 @@ $(HEADERNAV_TOC)
69
69
alias Name = AliasSeq!(int, 42);
70
70
pragma(msg, Name[0]); // int
71
71
pragma(msg, Name[1]); // 42
72
- // or work with a list directly
72
+ // or work with a sequence directly
73
73
pragma(msg, AliasSeq!("aaa", 0, double)[2]); // double
74
74
---
75
75
@@ -96,27 +96,27 @@ $(H2 $(LNAME2 available-operations, Available operations))
96
96
97
97
$(H3 $(LNAME2 assignment, Assignment))
98
98
99
- $(P Works only if the list element is a symbol that refers to a mutable variable)
99
+ $(P Works only if the sequence element is a symbol that refers to a mutable variable)
100
100
101
101
---
102
102
import std.meta;
103
103
104
104
void main()
105
105
{
106
106
int x;
107
- alias List = AliasSeq!(10, x);
108
- List [1] = 42;
107
+ alias seq = AliasSeq!(10, x);
108
+ seq [1] = 42;
109
109
assert (x == 42);
110
- // List [0] = 42; // won't compile, can't assign to a constant
110
+ // seq [0] = 42; // won't compile, can't assign to a constant
111
111
}
112
112
---
113
113
114
114
$(H3 $(LNAME2 loops, Loops))
115
115
116
116
$(P D's $(LINK2 spec/statement.html#ForeachStatement, foreach statement) has special
117
- semantics when iterating over compile-time lists . It repeats the body of the loop
118
- for each of the list elements, with the loop iteration "variable" becoming an alias
119
- for each compile-time list element in turn.
117
+ semantics when iterating over compile-time sequences . It repeats the body of the loop
118
+ for each of the sequence elements, with the loop iteration "variable" becoming an alias
119
+ for each compile-time sequence element in turn.
120
120
)
121
121
122
122
---
@@ -146,8 +146,8 @@ $(H2 $(LNAME2 available-operations, Available operations))
146
146
147
147
$(H2 $(LNAME2 auto-expansion, Auto-expansion))
148
148
149
- $(P One less obvious property of compile-time argument lists is that when used
150
- as an argument to a function or template, they are automatically treated as a list
149
+ $(P One less obvious property of compile-time argument sequences is that when used
150
+ as an argument to a function or template, they are automatically treated as a sequence
151
151
of comma-separated arguments:
152
152
)
153
153
@@ -165,29 +165,29 @@ $(H2 $(LNAME2 auto-expansion, Auto-expansion))
165
165
$(P This will only print `int` during compilation because the last line gets rewritten
166
166
as `alias Dummy = Print0!(int, double)`. If auto-expansion didn't happen,
167
167
`AliasSeq!(int, double)` would be printed instead. This is an inherent part of
168
- the language semantics for variadic lists , and thus also preserved by `AliasSeq`.
168
+ the language semantics for variadic sequences , and thus also preserved by `AliasSeq`.
169
169
)
170
170
171
- $(H2 $(LNAME2 homogenous-lists , Homogenous lists ))
171
+ $(H2 $(LNAME2 homogenous-sequences , Homogenous sequences ))
172
172
173
- $(P An $(ALOCAL AliasSeq, AliasSeq) that consists of only type or expression ( value) elements are
174
- commonly called "type lists " or "expression lists " respectively. The concept of
175
- a "symbol list " is rarely mentioned explicitly but fits the same pattern.
173
+ $(P An $(ALOCAL AliasSeq, AliasSeq) that consists of only type or value elements are
174
+ commonly called "type sequences " or "value sequences " respectively. The concept of
175
+ a "symbol sequence " is rarely mentioned explicitly but fits the same pattern.
176
176
)
177
177
178
- $(H3 $(LNAME2 type-seq, Type lists ))
178
+ $(H3 $(LNAME2 type-seq, Type sequences ))
179
179
180
- $(P It is possible to use homogenous type lists in declarations:)
180
+ $(P It is possible to use homogenous type sequences in declarations:)
181
181
182
182
---
183
183
import std.meta;
184
184
alias Params = AliasSeq!(int, double, string);
185
185
void foo(Params); // void foo(int, double, string);
186
186
---
187
187
188
- $(H4 $(LNAME2 type-seq-instantiation, Type list instantiation))
188
+ $(H4 $(LNAME2 type-seq-instantiation, Type sequence instantiation))
189
189
190
- $(P D supports a special variable declaration syntax where a type list acts as a type:)
190
+ $(P D supports a special variable declaration syntax where a type sequence acts as a type:)
191
191
192
192
---
193
193
import std.meta;
@@ -208,38 +208,38 @@ $(H4 $(LNAME2 type-seq-instantiation, Type list instantiation))
208
208
alias variables = AliasSeq!(__var1, __var2, __var3);
209
209
---
210
210
211
- $(P So a type list instance acts as a symbol list that only aliases
211
+ $(P So a type sequence instance acts as a symbol sequence that only aliases
212
212
variables.)
213
213
214
214
$(P $(DDSUBLINK spec/template, variadic-templates, Variadic template functions)
215
- use a type list instance for a function parameter:)
215
+ use a type sequence instance for a function parameter:)
216
216
217
217
---
218
218
void foo(T...)(T args)
219
219
{
220
- // 'T' is a type list of argument types.
220
+ // 'T' is a type sequence of argument types.
221
221
// 'args' is an instance of T whose elements are the function parameters
222
222
static assert(is(typeof(args) == T));
223
223
args[0] = T[0].init;
224
224
}
225
225
---
226
226
227
- $(P $(B Note:) $(PHOBOS typecons, .Tuple, std.typecons.Tuple) wraps a type list instance,
227
+ $(P $(B Note:) $(PHOBOS typecons, .Tuple, std.typecons.Tuple) wraps a type sequence instance,
228
228
preventing auto-expansion, and allowing it to be returned from functions.)
229
229
230
- $(H3 $(LNAME2 value-seq, Expression lists ))
230
+ $(H3 $(LNAME2 value-seq, Value sequences ))
231
231
232
- $(P It is possible to use expression lists with values of the same type to declare array literals:)
232
+ $(P It is possible to use value sequences with values of the same type to declare array literals:)
233
233
234
234
---
235
235
import std.meta;
236
236
static assert ([ AliasSeq!(1, 2, 3) ] == [ 1, 2, 3 ]);
237
237
---
238
238
239
- $(H4 $(LNAME2 tupleof, Aggregate field lists ))
239
+ $(H3 $(LNAME2 symbol-seq, Symbol sequences ))
240
240
241
241
$(P $(DDSUBLINK spec/class, class_properties, `.tupleof`) is a
242
- class/struct instance property that provides an expression list
242
+ class/struct instance property that provides a symbol sequence
243
243
of fields.)
244
244
245
245
)
0 commit comments