-
Notifications
You must be signed in to change notification settings - Fork 58
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
treemap
is broken?
#54
Comments
I am running into the same problem, is there a way to properly use this function such that it works? |
Can either of you tell me what the expected return value of |
That's a good question. Since from the definition of tree = Node(1,
[Node(2,
[Node(3, []),
Node(4, [])]),
Node(5, [])]) should map to tree2 = Node(1,
[Node(4,
[Node(9, []),
Node(16, [])]),
Node(25, [])]) (and yes, it should return It seems though, that tree = [1, [[2, [3, 4]], 5]] In this case, treemap(x -> x^2, tree) = [1, [[4, [9, 16]], 25]] You can see this here: https://github.com/JuliaCollections/AbstractTrees.jl/blob/master/src/iteration.jl#L347 But at the same time, now we do not use this representation for trees, so
where
Then |
It looks like
treemap
is broken or at least maybe documentation example is needed?With this setup, I wasn't able to run
treemap
in any configuration. FIrst of all, it accepts onlyPostOrderDFS
types. Why can't I just passtree
and it internally callPostOrderDFS
on it?Secondly, call like this
return error
I can pirate it to ( I am completely at loss, what I am doing at this moment, actually)
This helps to go through this error, but it looks like function require more than one argument, so I change call to
And then I get into error
Help shows that it is true, there is no
copy!
with 5 arguments in Base.So, how this function is supposed to be used? Is it working at all?
The text was updated successfully, but these errors were encountered: