You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm steadily building a library of functions written in the miller DSL.
It would be useful to be able to source them into my scripts with a c-style #include statement.
The text was updated successfully, but these errors were encountered:
@vapniks thanks for the request. I've never been eager to go this route -- C's include pattern has been (IMO) an antipattern over the years; being moved away from in other languages since, such as Java and Go; and C++ itself is moving (albeit slowly) along the module route and away from includes.
At a more concrete level, there are potential user-level confusions such as having a #include line inside curly braces, difficulty debugging when the include is in the wrong place, difficulty debugging when the include is in the intended place but the code isn't functioning as desired. Also implementation-level snags such the possibility of infinite recursion.
If you haven't checked that out, please do! If you already have and it isn't working well for you, my preference would be to have a conversation about how to make it better fit your needs.
FYI there is a support for @include in GNU awk (aka gawk). The gawk manual also describes how to code the feature for other awks, to make awk libraries more portable.
I think this basic gawk-like feature would be welcome by miller users, no need for anything complicated like in C, imho.
johnkerl
changed the title
Feature request: #include statements for DSL
Feature request: #include statements for DSL
Jan 25, 2024
I'm steadily building a library of functions written in the miller DSL.
It would be useful to be able to source them into my scripts with a c-style #include statement.
The text was updated successfully, but these errors were encountered: