These are chat archives for ChaiScript/ChaiScript

4th
Dec 2017
Samuel Barney
@SamJBarney
Dec 04 2017 17:31
I have a quick question. Is there a null equivalent in chaiscript? I haven't seen any docs on anything like that, but I may just be looking in the wrong place
Jason Turner
@lefticus
Dec 04 2017 17:50
there's empty for a value that doesn't hold anything and null for a value that is a pointer that is null
is_empty() and is_null()
Samuel Barney
@SamJBarney
Dec 04 2017 17:54
Is there a way on the script side to return null? I'm using chai version 6.0.0, and it complains about null not existing
Jason Turner
@lefticus
Dec 04 2017 17:57
hmm, I don't think so
null would have the problem of having to be a void without other type information available, then we'd have all kinds of not-fun trying to coerce that into some other type of typed
Samuel Barney
@SamJBarney
Dec 04 2017 17:59
Dang. K. Guess I'll have to rethink how I'm prototyping then
Jason Turner
@lefticus
Dec 04 2017 18:50
you can write your own function that returns a typed pointer that you need
Samuel Barney
@SamJBarney
Dec 04 2017 19:12
Yeah. I was just hoping to be able to do it right out of the box