Skip to content

Commit c34dbe8

Browse files
authored
[spec/function] Add Hidden Parameters section (#3375)
Link to `this` parameter section in expression.dd. Mention D-style variadic hidden parameters.
1 parent 2e829c5 commit c34dbe8

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

spec/class.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ $(H2 $(LNAME2 super_class, Super Class))
225225
$(H2 $(LNAME2 member-functions, Member Functions (a.k.a. Methods)))
226226

227227
$(P Non-static member functions have an extra hidden parameter
228-
called $(I this) through which the class object's other members
228+
called $(DDSUBLINK spec/expression, this, `this`) through which the class object's other members
229229
can be accessed.
230230
)
231231

spec/const3.dd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ $(H2 $(LNAME2 immutable_member_functions, Immutable Member Functions))
343343

344344
$(P
345345
Immutable member functions are guaranteed that the object
346-
and anything referred to by the $(CODE this) reference is immutable.
346+
and anything referred to by the $(DDSUBLINK spec/expression, this, `this` reference)
347+
is immutable.
347348
They are declared as:
348349
)
349350

@@ -407,7 +408,7 @@ $(H2 $(LNAME2 const_member_functions, Const Member Functions))
407408
$(P
408409
Const member functions are functions that are not allowed to
409410
change any part of the object through the member function's
410-
this reference.
411+
$(DDSUBLINK spec/expression, this, `this` reference).
411412
)
412413

413414

spec/function.dd

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,18 +2382,22 @@ $(H4 $(LNAME2 lazy_variadic_functions, Lazy Variadic Functions))
23822382
parameter. This will prevent a closure being generated for the delegate,
23832383
as `scope` means the delegate will not escape the function.)
23842384

2385-
$(H3 $(LNAME2 this-reference, `this` Reference))
2385+
$(LEGACY_LNAME2 this-reference)
2386+
$(H3 $(LNAME2 hidden-parameters, Hidden Parameters))
23862387

2387-
$(P
2388+
$(UL
2389+
$(LI
23882390
Non-static member functions all have a hidden parameter called the
2389-
`this` reference, which refers to the object for which
2391+
$(DDSUBLINK spec/expression, this, `this` reference), which refers to the object for which
23902392
the function is called.
23912393
)
2392-
2393-
$(P
2394+
$(LI D-style variadic functions have
2395+
$(RELATIVE_LINK2 d_style_variadic_functions, hidden parameters).)
2396+
$(LI
23942397
Functions with `Objective-C` linkage have an additional hidden,
23952398
unnamed, parameter which is the selector it was called with.
23962399
)
2400+
)
23972401

23982402

23992403
$(H2 $(LEGACY_LNAME2 Local Variables, local-variables, Local Variables))

0 commit comments

Comments
 (0)