Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The method filter(f, signal) doesn't work as desired #177

Open
eunjongkim opened this issue Apr 22, 2018 · 1 comment
Open

The method filter(f, signal) doesn't work as desired #177

eunjongkim opened this issue Apr 22, 2018 · 1 comment

Comments

@eunjongkim
Copy link

Hi,

I was following the example in the github page, and it turns out that the method definition filter{T}(f::Function, input::Signal{T}; kwargs...) is not working as intended.
First, when I input

filter(v -> v == :Alice, votes)

I get the following warning :

WARNING: filter(flt, itr) is deprecated, use Iterators.filter(flt, itr) instead.
Stacktrace:
 [1] depwarn(::String, ::Symbol) at .\deprecated.jl:70
 [2] filter(::Function, ::Reactive.Signal{Symbol}) at .\deprecated.jl:57
 [3] include_string(::String, ::String) at .\loading.jl:522
 [4] include_string(::Module, ::String, ::String) at C:\Users\ekim7\.julia\v0.6\Compat\src\Compat.jl:71
 [5] execute_request(::ZMQ.Socket, ::IJulia.Msg) at C:\Users\ekim7\.julia\v0.6\IJulia\src\execute_request.jl:158
 [6] (::Compat.#inner#17{Array{Any,1},IJulia.#execute_request,Tuple{ZMQ.Socket,IJulia.Msg}})() at C:\Users\ekim7\.julia\v0.6\Compat\src\Compat.jl:385
 [7] eventloop(::ZMQ.Socket) at C:\Users\ekim7\.julia\v0.6\IJulia\src\eventloop.jl:8
 [8] (::IJulia.##14#17)() at .\task.jl:335
while loading In[48], in expression starting on line 1
WARNING: filter(flt, itr) is deprecated, use Iterators.filter(flt, itr) instead.

This means that the the filter{T}(f::Function, input::Signal{T}; kwargs...) is directed to Base.filter, not Reactive.filter. Probably this happens due to deprecation.

@Teo-ShaoWei
Copy link

Seems like this issue has been resolved. Should it be closed?

This is what I get in the Julia REPL

julia> votes = Signal(:NoVote)
1: "input" = NoVote Symbol

julia> alice_votes = filter(v -> v == :Alice, votes)
2: "filter(input)" = NoVote Symbol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants