LibreCat / Catmandu

Catmandu - a data processing toolkit
https://librecat.org
176 stars 31 forks source link

Field selection with recursive path operator "..." #34

Open nichtich opened 11 years ago

nichtich commented 11 years ago

How about a path operator ... that selects of fields and subfields?:

# { foo => "  x ", bar => { foo = "  y "} }
trim("...foo") # { foo => "x", bar => { foo = "y"} }
vpeil commented 9 years ago

What about Data::Seek as a general solution for traversing complex hashes

phochste commented 9 years ago

This feature (and much more) will be available in the next release of Catmandu with the visitor() bind:

do visitor()
    if all_match(key,foo)
        trim(scalar)
    end
end

https://github.com/LibreCat/Catmandu/blob/dev/lib/Catmandu/Fix/Bind/visitor.pm

vpeil commented 9 years ago

this one can be closed, I suppose? The magic visitor bind has been released.

phochste commented 9 years ago

Visitor is one route. @nics is working on a new Fix path algorithm that can do the requests shorthand in a future release of Catmandu

nichtich commented 8 years ago

See #56 first.