Calling functions using mixins

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 1 14:50:50 PDT 2015


On Friday, 1 May 2015 at 21:41:10 UTC, Dennis Ritchie wrote:
> My final goal is to do something like this:
>
> -----
> import std.stdio, std.string;
>
> int foo() {
> 	return 5;
> }
>
> int bar() {
> 	return 10;
> }
>
> void main()
> {
> 	immutable string[] s = [ "foo", "bar" ];
>
> 	writeln(mixin(`format("%(%s, %)", s)`));;
> }

What's that supposed to do?


More information about the Digitalmars-d-learn mailing list