Create mixins from a list of strings
Casper Færgemand" <shorttail at hotmail.com>
Casper Færgemand" <shorttail at hotmail.com>
Fri Jan 10 23:45:29 PST 2014
Have:
enum (or is immutable array better?) array = ["derp", "lala"];
Want:
mixin("some syntax" ~ array[0]);
mixin("some syntax" ~ array[1]);
Basically, to specify a number of similar functions based on a
list of strings.
Why? Pegged's semantic actions allows only calling a function by
name, not specifying parameters. I could probably ask for an
extension, but if there's a cool template or whatever way to do
this, it would be a lot nicer. :3
More information about the Digitalmars-d-learn
mailing list