I’ve implemented a Julia Version of a “Multiplicative Partitions of a Number”. Since 0.7 the State, start … iteration changed. I got a pre 0.7 Version of a Tuple flattener on this Page: https://stackoverflow.com/questions/21129125/nested-list-comprehensions-in-julia
function flatten(x, y) state = start(x) if state==false push!(y, x) else while !done(x, state) (item, state) = next(x, state) flatten(item, y) end end y end flatten(x)=flatten(x,Array(Any, 0))
This doesn’t work anymore in 0.7, and the alternative:
only works to a nest-level of 4, while i need to flatten the tuples to an arbitrary depth.
Can someone tell me how to alter the flatten function code to work with 0.7?