Skip to content

Commit 359b9cc

Browse files
IanButterworthKristofferC
authored andcommitted
Fix logic in ? docstring example (#55945)
(cherry picked from commit 81ce6a4)
1 parent 099d07f commit 359b9cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

base/docs/basedocs.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,11 +931,14 @@ expression, rather than the side effects that evaluating `b` or `c` may have.
931931
See the manual section on [control flow](@ref man-conditional-evaluation) for more details.
932932
933933
# Examples
934-
```
934+
```jldoctest
935935
julia> x = 1; y = 2;
936936
937-
julia> x > y ? println("x is larger") : println("y is larger")
938-
y is larger
937+
julia> x > y ? println("x is larger") : println("x is not larger")
938+
x is not larger
939+
940+
julia> x > y ? "x is larger" : x == y ? "x and y are equal" : "y is larger"
941+
"y is larger"
939942
```
940943
"""
941944
kw"?", kw"?:"

0 commit comments

Comments
 (0)