This would be a backward-incompatible change, so, it would be Miller 5.0.0.
I initially chose $ for field names in analogy with awk: in awk you do $1, $2, $3; in Miller you do $Country, $City, $Region. That is well and good.
However, $ is also used by the shell and one way to build up Miller-DSL statements is to interpolate shell variables. E.g. now you have to do something like
for j in 1 2 3 4; do
mlr --from myfile.dat put '$output = '$j' * $i' # Note shell variable outside single quotes
done
With the proposed change, you could do
for i in 1 2 3 4; do
mlr --from myfile.dat put "%output = $j * %i" # Shell-vars with $ and field names with %
done
The expense, of course, is the need to update any scripts you already have which use the Miller DSL. (This only affects mlr put and mlr filter; non-DSL verbs like stats1 and sort are, of course, completely unaffected.)
In the absence of any feedback I'd prefer to make this change. (Scheduling of 5.0.0 is probably November/December 2016.) However, I'd definitely prefer some feedback. :)
johnkerl
changed the title from RFC: replace $ with % to RFC: replace $ with % in the Miller put/filter DSLOct 12, 2016
This would be a backward-incompatible change, so, it would be Miller 5.0.0.
I initially chose
$for field names in analogy withawk: inawkyou do$1,$2,$3; in Miller you do$Country,$City,$Region. That is well and good.However,
$is also used by the shell and one way to build up Miller-DSL statements is to interpolate shell variables. E.g. now you have to do something likeWith the proposed change, you could do
The expense, of course, is the need to update any scripts you already have which use the Miller DSL. (This only affects
mlr putandmlr filter; non-DSL verbs likestats1andsortare, of course, completely unaffected.)In the absence of any feedback I'd prefer to make this change. (Scheduling of 5.0.0 is probably November/December 2016.) However, I'd definitely prefer some feedback. :)