In case anyone is interested a working module is now available at https://github.com/kenneth-olwing/grep-query.git, also see an entry for it on PrePAN.

ken1

On 2016-07-26 10:39, kenn...@olwing.se wrote:
Hi David,

Many thanks for taking the time!

...
So, first of all, please do not take Scrooge. I am rather fond of that
name, and plan to publish my module with that name some day.

Noted :-) !

As to your idea, it looks like you're working with something like
grep. The key difference is that you provide some sort string parsing
for queries, along with a way to add keywords to those queries. In
that case, I think that GREP::QUERY might be the best name.

Yes - this is clearly better as it captures the essence. Basically:
'using this criteria, whittle down this list for me', which in normal
grep-speak means 'criteria' is either a BLOCK or EXPR, whereas I sort
of give the ability to have criteria be 'ARBITRARY QUERY'.

So yes, there's a small parser involved to parse the query language
(uses Parse::RecDescent for grammar).

Actually, I've already called the main method 'qgrep(...)' (i.e.
'query grep'), and also supply a tiny 'qgrep' script as a way to write
"qgrep 'some_query' ..." on the command line. So I should have seen it
coming :-).

Another
possibility, if you want to some day add map-like capabilities as
well, would be a top-level namespace. The name Matchbox comes to mind,
for some odd reason, with Matchbox::Grep and Matchbox::Map being your
two major namespaces.

I can't quite see what to do with that at the moment so I think
'Grep::Query' is a favourite right now. Given the fact that the actual
querying can be inside a block and on 'lists' with a single item, it
can be used in a map situation also. But any suggestions to do
something easier/better for map may be worth considering.

ken1

Reply via email to