Skip to content

Commit 3fe6e49

Browse files
committed
Change list -> sequence, expression list -> value sequence
Also fix tupleof: it's a symbol sequence, not a value sequence.
1 parent 6713a41 commit 3fe6e49

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

articles/ctarguments.dd

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ $(HEADERNAV_TOC)
66

77
$(H2 $(LNAME2 Background, Background))
88

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
1010
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.
1313
)
1414

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
1616
internals, but don't get confused - they don't have much in common with tuples that
1717
commonly exist in other languages. Sequences of values of different types that can be
1818
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
2020
should result in a $(LINK2 https://issues.dlang.org, documentation bug report).
2121
)
2222

@@ -29,7 +29,7 @@ $(HEADERNAV_TOC)
2929
$(P `T` here is a $(DDSUBLINK spec/template, variadic-templates, TemplateParameterSequence),
3030
which is a core language feature. It has its own special semantics,
3131
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
3333
and access any individual element:
3434
)
3535

@@ -49,7 +49,7 @@ $(HEADERNAV_TOC)
4949

5050
$(H2 $(LNAME2 AliasSeq, AliasSeq))
5151

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
5353
a template parameter declaration. Instead, there is a
5454
$(MREF_ALTTEXT simple utility, std, meta) provided by the standard
5555
library:
@@ -59,7 +59,7 @@ $(HEADERNAV_TOC)
5959
alias AliasSeq(T...) = T;
6060
---
6161

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
6363
that it can be worked with in any other context:
6464
)
6565

@@ -69,7 +69,7 @@ $(HEADERNAV_TOC)
6969
alias Name = AliasSeq!(int, 42);
7070
pragma(msg, Name[0]); // int
7171
pragma(msg, Name[1]); // 42
72-
// or work with a list directly
72+
// or work with a sequence directly
7373
pragma(msg, AliasSeq!("aaa", 0, double)[2]); // double
7474
---
7575

@@ -96,27 +96,27 @@ $(H2 $(LNAME2 available-operations, Available operations))
9696

9797
$(H3 $(LNAME2 assignment, Assignment))
9898

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)
100100

101101
---
102102
import std.meta;
103103

104104
void main()
105105
{
106106
int x;
107-
alias List = AliasSeq!(10, x);
108-
List[1] = 42;
107+
alias seq = AliasSeq!(10, x);
108+
seq[1] = 42;
109109
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
111111
}
112112
---
113113

114114
$(H3 $(LNAME2 loops, Loops))
115115

116116
$(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.
120120
)
121121

122122
---
@@ -146,8 +146,8 @@ $(H2 $(LNAME2 available-operations, Available operations))
146146

147147
$(H2 $(LNAME2 auto-expansion, Auto-expansion))
148148

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
151151
of comma-separated arguments:
152152
)
153153

@@ -165,29 +165,29 @@ $(H2 $(LNAME2 auto-expansion, Auto-expansion))
165165
$(P This will only print `int` during compilation because the last line gets rewritten
166166
as `alias Dummy = Print0!(int, double)`. If auto-expansion didn't happen,
167167
`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`.
169169
)
170170

171-
$(H2 $(LNAME2 homogenous-lists, Homogenous lists))
171+
$(H2 $(LNAME2 homogenous-sequences, Homogenous sequences))
172172

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.
176176
)
177177

178-
$(H3 $(LNAME2 type-seq, Type lists))
178+
$(H3 $(LNAME2 type-seq, Type sequences))
179179

180-
$(P It is possible to use homogenous type lists in declarations:)
180+
$(P It is possible to use homogenous type sequences in declarations:)
181181

182182
---
183183
import std.meta;
184184
alias Params = AliasSeq!(int, double, string);
185185
void foo(Params); // void foo(int, double, string);
186186
---
187187

188-
$(H4 $(LNAME2 type-seq-instantiation, Type list instantiation))
188+
$(H4 $(LNAME2 type-seq-instantiation, Type sequence instantiation))
189189

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:)
191191

192192
---
193193
import std.meta;
@@ -208,38 +208,38 @@ $(H4 $(LNAME2 type-seq-instantiation, Type list instantiation))
208208
alias variables = AliasSeq!(__var1, __var2, __var3);
209209
---
210210

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
212212
variables.)
213213

214214
$(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:)
216216

217217
---
218218
void foo(T...)(T args)
219219
{
220-
// 'T' is a type list of argument types.
220+
// 'T' is a type sequence of argument types.
221221
// 'args' is an instance of T whose elements are the function parameters
222222
static assert(is(typeof(args) == T));
223223
args[0] = T[0].init;
224224
}
225225
---
226226

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,
228228
preventing auto-expansion, and allowing it to be returned from functions.)
229229

230-
$(H3 $(LNAME2 value-seq, Expression lists))
230+
$(H3 $(LNAME2 value-seq, Value sequences))
231231

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:)
233233

234234
---
235235
import std.meta;
236236
static assert ([ AliasSeq!(1, 2, 3) ] == [ 1, 2, 3 ]);
237237
---
238238

239-
$(H4 $(LNAME2 tupleof, Aggregate field lists))
239+
$(H3 $(LNAME2 symbol-seq, Symbol sequences))
240240

241241
$(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
243243
of fields.)
244244

245245
)

0 commit comments

Comments
 (0)