DataStructures.Queue is doing strange things for me.
Can someone please post proper syntax for forward declarations of an empty
Queue{ByteString} and maybe an in-line instantiation (if different) so I
can be sure that I am getting the declarations right?
When I do:
using DataStructures;
qbs = Queue{ByteString}() # --> convert errors
qbs = Queue{ByteString}(0) # --> convert errors
qbs = Queue{ByteString}("") # --> no errors, so ok?
typeof(qbs) # -->
DataStructures.Queue{ByteString} (so far, so good)
length(qbs) # --> 0 (hmmm)
# which seems ok, but ...
qbs = Queue{ByteString}("1234") # ok
typeof(qbs) # -->
DataStructures.Queue{ByteString}
length(qbs) # --> 4 ??? why not 1?
enqueue!(qbs, "xyz") # --> MethodError: `push!` has
no method matching push!(::ASCIIString, ::ASCIIString ) in queue.jl:17
x = dequeue!( qbs ) # --> MethodError: `shift!` has
no method matching shift!(::ASCIIString) in ... dequeue! at queue.jl:21
so... I am growing increasingly mystified. How can the type be right when
you ask for it, but wrong when you use it? Maybe I'm declaring it wrong?
Any insight or suggestions would be appreciated.