From f005c053d923e0029ada900f2ac49446b8227e67 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Tue, 18 Jun 2024 17:09:44 +0900 Subject: [PATCH] refine the docstring a bit --- base/experimental.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/base/experimental.jl b/base/experimental.jl index a2228267a6a6b5..b7f64c9896e4fe 100644 --- a/base/experimental.jl +++ b/base/experimental.jl @@ -375,18 +375,20 @@ non-overlayed method call. More formally, when evaluating a generic function call ``f(x)`` at a specific world age ``i``, if a regular method call ``fᵢ(x)`` is redirected to an overlay method call ``fᵢ′(x)`` -defined by this macro, it must be ensured that ``fᵢ(x) ≡ fᵢ′(x)``. +defined by this macro, ``fᵢ(x)`` and ``fᵢ′(x)`` are considered `:consistent` if the following +conditions are met: +- If ``fᵢ(x)`` returns a value ``y``, then ``fᵢ′(x)`` also returns some value ``yᵢ``, and ``y ≡ yᵢ`` holds. +- If ``fᵢ(x)`` throws an exception, then ``fᵢ′(x)`` also throws some exception. For a detailed definition of `:consistent`-cy, consult the corresponding section in [`Base.@assume_effects`](@ref). !!! note Note that the requirements for `:consistent`-cy include not only that the return values - are egal, but also that the manner of termination is the same. - However, it's important to aware that when they throw exceptions, the exceptions - themselves don't necessarily have to be egal as explained in the note of `:consistent`. - In other words, if ``fᵢ(x)`` throws an exception, ``fᵢ′(x)`` is required to also throw - one, but the exact exceptions may differ. + are egal, but also that the manner of termination is the same. However, it's important + to aware that when they throw exceptions, the exceptions themselves don't necessarily + have to be egal. In other words, if ``fᵢ(x)`` throws an exception, ``fᵢ′(x)`` is + required to also throw one, but the exact exceptions may differ. !!! note Please note that the `:consistent`-cy requirement applies not to method itself but to