@@ -100,44 +100,6 @@ $(H4 Rationale)
100
100
would break the guarantees of the $(D nothrow) attribute.
101
101
)
102
102
103
- $(H3 $(DEPNAME body keyword))
104
- $(P 'body' was a keyword used to specify a function/method's body in the presence of contracts
105
- ---
106
- class Foo
107
- {
108
- void bar(int i)
109
- in { assert(i >= 42); }
110
- body { /* Do something interesting */ }
111
-
112
- string method(string s)
113
- out(v) { assert(v.length == s.length); }
114
- body { /* Do something even more interesting */ }
115
-
116
- void noBody() { /* No contracts, no body */ }
117
- }
118
- ---
119
- )
120
- $(H4 Corrective Action)
121
- $(P Use the 'do' keyword instead (introduced v2.075.0)
122
- ---
123
- void bar(int i)
124
- in { assert(i >= 42); }
125
- do { /* Look ma, no body! */ }
126
- ---
127
- )
128
- $(H4 Rationale)
129
- $(P The 'body' keyword was only used for this single purpose.
130
- Since D grammar aims to be context free, this common word was reserved,
131
- which led to frequent trouble for people interfacing with other languages
132
- (e.g. javascript) or auto-generating code.
133
- )
134
- $(P Note that given the large amount of code relying on the 'body' keyword
135
- (essentially any code using contracts), and the fact that the benefit
136
- of DIP1003 to the user are mostly the ability to use 'body' as an identifier,
137
- the deprecation has been postponed beyond its original goal of 2.091.0.
138
- Users are still encouraged to use 'do' for future-proofness.
139
- )
140
-
141
103
$(H3 $(DEPNAME Hexstring literals))
142
104
$(P Hexstring literals can be used to enter literals in base 16.
143
105
---
0 commit comments