Skip to content

Commit 78a18c4

Browse files
Add isbinop dispatches
1 parent 7e901bf commit 78a18c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/discretedomain.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ struct SampleTime <: Operator
55
end
66
SymbolicUtils.promote_symtype(::Type{<:SampleTime}, t...) = Real
77
Base.nameof(::SampleTime) = :SampleTime
8+
SymbolicUtils.isbinop(::SampleTime) = false
89

910
# Shift
1011

@@ -34,6 +35,7 @@ end
3435
Shift(steps::Int) = new(nothing, steps)
3536
normalize_to_differential(s::Shift) = Differential(s.t)^s.steps
3637
Base.nameof(::Shift) = :Shift
38+
SymbolicUtils.isbinop(::Shift) = false
3739

3840
function (D::Shift)(x, allow_zero = false)
3941
!allow_zero && D.steps == 0 && return x
@@ -112,6 +114,7 @@ Sample(x) = Sample()(x)
112114
(D::Sample)(x::Num) = Num(D(value(x)))
113115
SymbolicUtils.promote_symtype(::Sample, x) = x
114116
Base.nameof(::Sample) = :Sample
117+
SymbolicUtils.isbinop(::Sample) = false
115118

116119
Base.show(io::IO, D::Sample) = print(io, "Sample(", D.clock, ")")
117120

@@ -142,6 +145,7 @@ end
142145
(D::Hold)(x::Num) = Num(D(value(x)))
143146
SymbolicUtils.promote_symtype(::Hold, x) = x
144147
Base.nameof(::Hold) = :Hold
148+
SymbolicUtils.isbinop(::Hold) = false
145149

146150
Hold(x) = Hold()(x)
147151

0 commit comments

Comments
 (0)