Glen Fraser

Results 110 comments of Glen Fraser

From Chaiscript code, if you write `use("file")` instead of `eval_file("file")`, then it will only evaluate "file" once.

Are you compiling as a console application or regular Windows application? If a console application, the standard outputs should appear there already. If it's built as a Windows application, then...

I usually wrap script code in braces `{}` when I want to evaluate some test code multiple times. This gives it a scope, and any declared variables are local and...

> I don't know how to fix that issue. Any ideas? Don't use a static variable? (-; Allocate your ChaiScript instance on the heap and hold it with a unique_ptr?...

I also [mentioned](https://chaiscript.discoursehosting.net/t/variable-number-of-arguments-possible/246/5) this on discourse, a couple of weeks ago. There I discovered a less-than-ideal workaround, storing things in Pairs (and just ignoring the `second` element). > Strangely, I've...

Yes, I'm using b7e8897 from Dec. 29, 2016. But it doesn't seem to work. Do I have to do something to "force" the cast to a bool? Or in scripting,...

Nope, that doesn't work either. In that case, I get: ```c++ if (o.callbackFunc) { // gives Error: "Condition not boolean" print("callback set"); } if (!o.callbackFunc) { // gives Error: "Error...

Here is an [example program (Gist)](https://gist.github.com/totalgee/a173bdbbfb184354bad3a999c252b2cf) that illustrates what I'm trying right now, maybe you'll find a way to do what I'm wanting... Thanks!

Okay, but in response to your last comment, note that I **am** able to call my callback fine from scripting...

FYI I was able to call (via scripting) a callback member std::function that had a) been set in C++ (assigning a lambda) or b) set in ChaiScript (assigning a lambda...