Skip to content

Commit 81ce6a4

Browse files
Fix logic in ? docstring example (#55945)
1 parent 4eb2e47 commit 81ce6a4

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
@@ -937,11 +937,14 @@ expression, rather than the side effects that evaluating `b` or `c` may have.
937937
See the manual section on [control flow](@ref man-conditional-evaluation) for more details.
938938
939939
# Examples
940-
```
940+
```jldoctest
941941
julia> x = 1; y = 2;
942942
943-
julia> x > y ? println("x is larger") : println("y is larger")
944-
y is larger
943+
julia> x > y ? println("x is larger") : println("x is not larger")
944+
x is not larger
945+
946+
julia> x > y ? "x is larger" : x == y ? "x and y are equal" : "y is larger"
947+
"y is larger"
945948
```
946949
"""
947950
kw"?", kw"?:"

0 commit comments

Comments
 (0)