diff --git a/base/expr.jl b/base/expr.jl index 3b0a859f7ef7e..8e83926a332f3 100644 --- a/base/expr.jl +++ b/base/expr.jl @@ -437,7 +437,7 @@ The following `setting`s are supported. # Extended help --- -# `:consistent` +## `:consistent` The `:consistent` setting asserts that for egal (`===`) inputs: - The manner of termination (return value, exception, non-termination) will always be the same. @@ -472,7 +472,7 @@ The `:consistent` setting asserts that for egal (`===`) inputs: itself is not required to meet the egality requirement specified above. --- -# `:effect_free` +## `:effect_free` The `:effect_free` setting asserts that the method is free of externally semantically visible side effects. The following is an incomplete list of externally semantically @@ -502,7 +502,7 @@ were not executed. valid for all world ages and limit use of this assertion accordingly. --- -# `:nothrow` +## `:nothrow` The `:nothrow` settings asserts that this method does not terminate abnormally (i.e. will either always return a value or never return). @@ -516,7 +516,7 @@ The `:nothrow` settings asserts that this method does not terminate abnormally `MethodErrors` and similar exceptions count as abnormal termination. --- -# `:terminates_globally` +## `:terminates_globally` The `:terminates_globally` settings asserts that this method will eventually terminate (either normally or abnormally), i.e. does not loop indefinitely. @@ -531,7 +531,7 @@ The `:terminates_globally` settings asserts that this method will eventually ter on a method that *technically*, but not *practically*, terminates. --- -# `:terminates_locally` +## `:terminates_locally` The `:terminates_locally` setting is like `:terminates_globally`, except that it only applies to syntactic control flow *within* the annotated method. It is thus @@ -542,7 +542,7 @@ non-termination if the method calls some other method that does not terminate. `:terminates_globally` implies `:terminates_locally`. --- -# `:notaskstate` +## `:notaskstate` The `:notaskstate` setting asserts that the method does not use or modify the local task state (task local storage, RNG state, etc.) and may thus be safely @@ -569,7 +569,7 @@ moved between tasks without observable results. may still be dead-code-eliminated and thus promoted to `:total`. --- -# `:foldable` +## `:foldable` This setting is a convenient shortcut for the set of effects that the compiler requires to be guaranteed to constant fold a call at compile time. It is @@ -586,7 +586,7 @@ currently equivalent to the following `setting`s: must consistently throw given the same argument values. --- -# `:total` +## `:total` This `setting` is the maximum possible set of effects. It currently implies the following other `setting`s: @@ -598,7 +598,7 @@ the following other `setting`s: !!! warning `:total` is a very strong assertion and will likely gain additional semantics - in future versions of julia (e.g. if additional effects are added and included + in future versions of Julia (e.g. if additional effects are added and included in the definition of `:total`). As a result, it should be used with care. Whenever possible, prefer to use the minimum possible set of specific effect assertions required for a particular application. In cases where a large @@ -606,13 +606,13 @@ the following other `setting`s: recommended over the use of `:total`. --- - ## Negated effects Effect names may be prefixed by `!` to indicate that the effect should be removed from an earlier meta effect. For example, `:total !:nothrow` indicates that while the call is generally total, it may however throw. +--- ## Comparison to `@pure` `@assume_effects :foldable` is similar to [`@pure`](@ref) with the primary