pranavtbhat / Graft.jl

Graph Toolkit for Julia
Other
30 stars 5 forks source link

Query overhaul #26

Open pranavtbhat opened 8 years ago

pranavtbhat commented 8 years ago

Move away from macro based piped queries. A clean composable syntax would probably work much better.

New queries:

The ability to override getfield would definitely come in handy.

Something like:

immutable Vertex
end

immutable Edge
end

const v = Vertex()
const e = Edge()

getfield(::Vertex, s::Symbol) = VertexProperty(s)
getfield(::Edge, s::Symbol) = EdgeProperty(s)

The queries can then look like:

filter(g, v.p1 < 5)
eachedge(g, e.p1, e.p2)