Skip to content

Commit 32dec24

Browse files
WalterBrightdlang-bot
authored andcommitted
function.dd: use BEST_PRACTICE and IMPLEMENTATION_DEFINED
1 parent 3fcfc3d commit 32dec24

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

spec/function.dd

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ $(H2 $(LNAME2 contracts, Contracts))
157157
$(P The $(D in) and $(D out) blocks or expressions of a function declaration specify
158158
the pre- and post-conditions of the function. They are used in
159159
$(LINK2 contracts.html, Contract Programming).
160+
)
161+
162+
$(BEST_PRACTICE
160163
The code inside these blocks should
161164
not have any side-effects, including modifying function parameters
162165
and/or return values.
@@ -1066,10 +1069,11 @@ void main()
10661069
$(H2 $(LNAME2 inline-functions, Inline Functions))
10671070

10681071
$(P The compiler makes the decision whether to inline a function or not.
1069-
This decision may be controlled by $(LINK2 pragma.html#inline, `pragma(inline)`),
1070-
assuming that the compiler implements it, which is not mandatory.)
1072+
This decision may be controlled by $(LINK2 pragma.html#inline, `pragma(inline)`).)
10711073

1072-
$(P Note that any $(GLINK2 expression, FunctionLiteral) should be inlined
1074+
$(IMPLEMENTATION_DEFINED
1075+
Whether a function is inlined or not is implementation defined, though
1076+
any $(GLINK2 expression, FunctionLiteral) should be inlined
10731077
when used in its declaration scope.
10741078
)
10751079

@@ -2098,9 +2102,10 @@ void main()
20982102
$(H2 $(LEGACY_LNAME2 Local Variables, local-variables, Local Variables))
20992103

21002104
$(P It is an error to use a local variable without first assigning it a
2101-
value. The implementation may not always be able to detect these
2102-
cases. Other language compilers sometimes issue a warning for this,
2103-
but since it is always a bug, it should be an error.
2105+
value.)
2106+
2107+
$(IMPLEMENTATION_DEFINED The implementation may not always be able
2108+
to detect these cases.
21042109
)
21052110

21062111
$(P It is an error to declare a local variable that hides another local

0 commit comments

Comments
 (0)