Hi, very nice library; I have noticed the following:
Assume you have a type where you have specified the constructor:
struct Trial
x::Float64
Trial(x_::Float64)=new(x_)
end
If I try to build a Signal from that I get:
Signal(Trial,1.0)
ERROR: MethodError: no method matching Signal(::Type{Trial}, ::Float64)
Closest candidates are:
Signal(::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at .julia\packages\Signals\559HJ\src\Signal.jl:11
Signal(::Function, ::Any...; state, strict_push, pull_type, v0) at .julia\packages\Signals\559HJ\src\Signal.jl:52
Signal(::Any; kwargs...) at .julia\packages\Signals\559HJ\src\Signal.jl:47
Stacktrace:
[1] top-level scope at REPL[31]:1
The trivial workaround is to build the signal directly using:
sig=Signal(Trial(1.0))
Signal
value: Trial(1.0)
But this would not work in case 1.0 is a signal.
The proper way to do this is to build the Signal using the do syntax, but in case of multiple structs in can be awful to read.
Would it be possible to implement a signal costructor for types as well?
Hi, very nice library; I have noticed the following:
Assume you have a type where you have specified the constructor:
If I try to build a Signal from that I get:
The trivial workaround is to build the signal directly using:
But this would not work in case 1.0 is a signal.
The proper way to do this is to build the Signal using the do syntax, but in case of multiple structs in can be awful to read.
Would it be possible to implement a signal costructor for types as well?