ERROR: no method |>(ASCIIString, Type{IOBuffer})

62 views
Skip to first unread message

Rick Graham

unread,
Jun 16, 2014, 12:06:24 AM6/16/14
to juli...@googlegroups.com
Should there be a method  |>(ASCIIString, Type{IOBuffer}) ?

julia> "A string" |> typeof
ASCIIString (constructor with 2 methods)


julia
> "A string" |> IOBuffer
ERROR
: no method |>(ASCIIString, Type{IOBuffer})




Kevin Squire

unread,
Jun 16, 2014, 12:53:03 AM6/16/14
to juli...@googlegroups.com
|> works with normal functions, but the way it is written right now, it doesn't work with type constructors.

Assuming this is wanted, the fix is trivial: change the definition of 

|>(x, f::Function) = f(x)

in operators.jl:173 to 

|>(x, f::Callable) = f(x)

If you're up to it, please file a pull request.  (If there's some reason it shouldn't be defined that way, the PR will get feedback to that extent.)

Cheers,
   Kevin

Reply all
Reply to author
Forward
0 new messages