From f200325bd56ba385308596e42e38ee8f0d9900a9 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 1 Jun 2020 18:45:47 +0100 Subject: [PATCH 1/3] Minor tweaks to class.dd --- spec/class.dd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/class.dd b/spec/class.dd index 3cd92b3c8d..1a558e0a93 100644 --- a/spec/class.dd +++ b/spec/class.dd @@ -110,7 +110,7 @@ $(H2 $(LNAME2 access_control, Access Control)) $(H2 $(LNAME2 fields, Fields)) - $(P Class members are always accessed with the . operator. + $(P Class members are always accessed with the `.` operator. ) $(P Members of a base class can be accessed by prepending the name of @@ -206,8 +206,8 @@ void test(Foo foo) $(H2 $(LNAME2 super_class, Super Class)) All classes inherit from a super class. If one is not specified, - it inherits from Object. Object forms the root of the D class - inheritance hierarchy. + it inherits from $(REF1 Object, object). `Object` forms the root + of the D class inheritance hierarchy. $(H2 $(LNAME2 member-functions, Member Functions)) From f9745e2910a33409dabf2150d87fff759a7ae4d2 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 2 Jun 2020 09:51:21 +0100 Subject: [PATCH 2/3] Move Objective-C method specifics to subsection --- spec/class.dd | 33 ++++++++++++++++++++------------- spec/function.dd | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/spec/class.dd b/spec/class.dd index 1a558e0a93..ebfa41ced1 100644 --- a/spec/class.dd +++ b/spec/class.dd @@ -209,16 +209,11 @@ $(H2 $(LNAME2 super_class, Super Class)) it inherits from $(REF1 Object, object). `Object` forms the root of the D class inheritance hierarchy. -$(H2 $(LNAME2 member-functions, Member Functions)) +$(H2 $(LNAME2 member-functions, Member Functions (a.k.a. Methods))) - $(P Non-static member functions or static member functions with - `Objective-C` linkage have an extra hidden parameter called $(I this) - through which the class object's other members can be accessed. - ) - - $(P Member functions with the Objective-C linkage has an additional - hidden, anonymous, parameter which is the selector the function was - called with. + $(P Non-static member functions have an extra hidden parameter + called $(I this) through which the class object's other members + can be accessed. ) $(P Non-static member functions can have, in addition to the usual @@ -226,10 +221,6 @@ $(H2 $(LNAME2 member-functions, Member Functions)) $(D const), $(D immutable), $(D shared), or $(D inout). These attributes apply to the hidden $(I this) parameter. ) - - $(P Static member functions with the Objective-C linkage are placed in - the hidden nested metaclass as non-static member functions. - ) --- class C { @@ -245,6 +236,22 @@ class C } --- +$(H3 $(LNAME2 objc-member-functions, Objective-C linkage)) + + $(P Static member functions with + `Objective-C` linkage also have an extra hidden parameter called $(I this) + through which the class object's other members can be accessed. + ) + + $(P Member functions with Objective-C linkage have an additional + hidden, anonymous, parameter which is the selector the function was + called with. + ) + + $(P Static member functions with Objective-C linkage are placed in + the hidden nested metaclass as non-static member functions. + ) + $(H2 $(LNAME2 synchronized-classes, Synchronized Classes)) diff --git a/spec/function.dd b/spec/function.dd index 170b815785..231421b4ed 100644 --- a/spec/function.dd +++ b/spec/function.dd @@ -801,7 +801,7 @@ class Bar : Foo ) $(P - Functions with `Objective-C` linkage has an additional hidden, + Functions with `Objective-C` linkage have an additional hidden, unnamed, parameter which is the selector it was called with. ) From 96d82d746bb5cd42976ebe0329f5f48af15eebec Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 2 Jun 2020 13:02:48 +0100 Subject: [PATCH 3/3] fix trailing whitespace --- spec/class.dd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/class.dd b/spec/class.dd index ebfa41ced1..c305ea5ff7 100644 --- a/spec/class.dd +++ b/spec/class.dd @@ -212,7 +212,7 @@ $(H2 $(LNAME2 super_class, Super Class)) $(H2 $(LNAME2 member-functions, Member Functions (a.k.a. Methods))) $(P Non-static member functions have an extra hidden parameter - called $(I this) through which the class object's other members + called $(I this) through which the class object's other members can be accessed. )