Impulse: C++
One of the goals of Impulse is to make bindings and glue code easy to write. Taking advantage of type constructors and operator overloading in C++, you can create a dynamic "language" that's fairly small:
val n = val(5) (pow_, 2);The first line above without sugar would be:
range(1, 5) lambda (each_,
cout << args[0] << endl;
)
val a = { 2 }, Args args(&a[0], &a[1]);Eeek! The second? well... let's not go there :) Actually, it's not bad - just 1 nested class macro.
val n = val(5).perform(_pow_, args);
0 Comments:
Post a Comment
<< Home