These are chat archives for ChaiScript/ChaiScript

7th
Apr 2015
Victor Lopez
@VictorJL
Apr 07 2015 21:19
Can I start a script with arguments?
Jason Turner
@lefticus
Apr 07 2015 23:05
not directly
you could do someting like: boxed_cast<std::function<void (int)>>(chai.eval_file("filename.chai"))(5); where filename.chai returns a function to execute...
that's kind of a round about way to do it
it would make sense to have some global ARGS variable (I hate globals, but that's what people do for this kind of thing, right?) or a main?... main seems odd to me given the nature of the script environment
well, tell me how you think that should work. I kind of like the 'return a function to execute' idea, because I think it's cleaner, but it'd want some help for just how to do that
Jason Turner
@lefticus
Apr 07 2015 23:17
@VictorJL It'd probably make the most sense for you to make issues for the things you've found. I got caught up on a "too many copies" issue the last day, but expect to get back to more direct bug fixes and usability things tomorrow hopefully