Skip to content

Commit c77da89

Browse files
automatic symbol conversions
1 parent 8e671e2 commit c77da89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/operations.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Base.convert(::Type{Operation}, x::Number) = Operation(identity, Expression[Cons
6262
Base.convert(::Type{Operation}, x::Operation) = x
6363
Base.convert(::Type{Operation}, x::Expression) = Operation(identity, Expression[x])
6464
Operation(x) = convert(Operation, x)
65+
Base.Symbol(O::Operation) = Symbol(convert(Variable,O))
66+
Base.convert(::Type{Symbol},O::Operation) = Symbol(convert(Variable,O))
6567

6668
#convert to Expr
6769
Base.Expr(op::Operation) = simplified_expr(op)

0 commit comments

Comments
 (0)