fizzy icon indicating copy to clipboard operation
fizzy copied to clipboard

Nice function execution API

Open chfast opened this issue 4 years ago • 1 comments

I think using methods instead of free function may be nicer and will be more JavaScript-like.

In particular, for function execution we may have something like:

auto instance = instantiate();

auto fn = instance->fn("func1");
fn(0, 1.0);

instance->fn("func2")(1, 2);

instance->fn(0)(-0.0f);   // Get function by index.

chfast avatar Jul 15 '20 14:07 chfast

Why is it important to be "Javascript-like"?

axic avatar Jul 15 '20 14:07 axic