Skip to content

Commit f86b11f

Browse files
IanButterworthKristofferC
authored andcommitted
Fix logic in ? docstring example (#55945)
(cherry picked from commit 81ce6a4)
1 parent dcf8f65 commit f86b11f

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
@@ -916,11 +916,14 @@ expression, rather than the side effects that evaluating `b` or `c` may have.
916916
See the manual section on [control flow](@ref man-conditional-evaluation) for more details.
917917
918918
# Examples
919-
```
919+
```jldoctest
920920
julia> x = 1; y = 2;
921921
922-
julia> x > y ? println("x is larger") : println("y is larger")
923-
y is larger
922+
julia> x > y ? println("x is larger") : println("x is not larger")
923+
x is not larger
924+
925+
julia> x > y ? "x is larger" : x == y ? "x and y are equal" : "y is larger"
926+
"y is larger"
924927
```
925928
"""
926929
kw"?", kw"?:"

0 commit comments

Comments
 (0)