[REBOL] Re: [AWK GREP] AWK and GREP funcs, arg order
From: gregg::pointillistic::com at: 18-May-2007 9:47
Ged:
GB> I think the logic is that the program/pattern is mostly likely to be
GB> reused against different files.
Anton:
AR> I say you're applying the program to the files, because without
AR> any files, there's no program.
Tom:
T> it is all data. why not let rawk figure out which is which
I agree with all of you. :) I like the idea of auto-identification,
but there may be ambiguity. The risk may be low enough that it's worth
it though.
In order to do that, it needs to be a dialect, rather than a func with
args for each one. I thought about that originally, but didn't come up
with one I liked, so I fell back on making it a simple func for the
time being (I was more concerned with the internals at that point).
What should the dialect look like? We have three categories of values:
* sources -- files to analyze, but I also support blocks and strings.
* program -- probably only one, with the pattern/action pairs as
sub-items.
* options -- e.g. /deep
For command line use, the programs and file specs will probably be
very simple, but you can write more complete programs and store them
in files. How flexible should it be with regard to applying multiple
source specs to multiple programs? For example, if you have
overlapping functionality, do you need to run multiple programs, or
reload a file list from a global spec for each "pass"?
-- Gregg