Skip to content

Is there a DSL way to apply a Miller verb in loop? #457

Answered by johnkerl
aborruso asked this question in Q&A
Discussion options

You must be logged in to vote

@aborruso DSL expressions don't call verbs per se -- however, under the hood a verb is a command-line wrapper around some code in a subroutine. That same code can have a second, DSL wrapper around it and, voilà, a function which is callable from the DSL.

Already-existing examples include seg2gmt which is a verb and a function; likewise the verb clean-whitespace and the function clean_whitespace.

So, we could do something similar here.

However, the fill-down verb is a bit trickier since it retains state from the previous record -- making it not a function solely of the current record.

For your use-case, which is fill-down over all fields -- maybe we could instead simply augment the existing

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@aborruso
Comment options

Answer selected by aborruso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants