Skip to content

Commit 4c60b5b

Browse files
Merge pull request #131 from JuliaDiffEq/hg/fix/display-var
Fix variable displaying in REPL
2 parents 5c8deea + 92e3588 commit 4c60b5b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/variables.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ end
99
(x::Variable)(args...) = Operation(x, collect(Expression, args))
1010

1111
Base.isequal(x::Variable, y::Variable) = (x.name, x.known) == (y.name, y.known)
12+
Base.print(io::IO, x::Variable) = show(io, x)
1213
Base.show(io::IO, x::Variable) = print(io, x.name)
14+
function Base.show(io::IO, ::MIME"text/plain", x::Variable)
15+
known = x.known ? "known" : "unknown"
16+
print(io, x.name, " (callable ", known, " variable)")
17+
end
1318

1419

1520
struct Constant <: Expression

0 commit comments

Comments
 (0)