These are chat archives for ChaiScript/ChaiScript

9th
Jun 2017
Jerry Smith
@dean1012
Jun 09 2017 02:20
Am I missing something or is it not possible to reassign a variable?
this shows what the same script looks like both working and not
hmm nevermind. I think I'm doing this wrong anyways at the moment.
Jason Turner
@lefticus
Jun 09 2017 03:13
if it's a type that you are exposing to chaiscript you need to also tell it about the operator= for assignment
Jerry Smith
@dean1012
Jun 09 2017 04:37
even if I'm not defining an operator overload?
Jerry Smith
@dean1012
Jun 09 2017 05:52
Ok I had to make an entire operator= overload and expose it but that worked!
Jason Turner
@lefticus
Jun 09 2017 12:18
No, you didn't have to make an operator= overload, the compiler does that for you, you just had to expose the one the compiler made
doing the overload also implies many other things, that you don't want to do
chai.add(chaiscript::fun([](Type &lhs, const Type &rhs){ return lhs = rhs; }), "=")