I was just fooling myself with some domain-specific language projects for a new C / C ++ project when I came up with this “weird” solution:
define DSL(...) MakeCommand(#__VA_ARGS__\ )->Exec()->GetResults() MyResults results = DSL( for p in people do something );
The good part is right by standards (but it is also a Duff Switch), and cross-platform, portable, etc. However, this method is really no better than writing lines to code, but since the DSL Engine parses lines anyway, it seems to look prettier and reduce clutter. But it was interesting what other people thought.
thanks
source share