These are chat archives for ChaiScript/ChaiScript

5th
Dec 2016
Justin
@hpsocket
Dec 05 2016 12:33
hello!
Jason Turner
@lefticus
Dec 05 2016 14:19
Hello!
Welcome to the channel
vovanre
@vovanre
Dec 05 2016 16:26
Hello all! I can redirect 'print' output (to OutputDebugString for example)?
StanEpp
@StanEpp
Dec 05 2016 16:39
@vovanre puts("DebugString")in chaiscript will print "DebugString" in the console.
StanEpp
@StanEpp
Dec 05 2016 16:55

@lefticus I've got some problems with registering functions with rvalue-references as parameter types. I generated the following minimal example

template<class TComp, class... TArgs>
void addC(TArgs&&... params) {}

int main(){
  auto modulePtr = std::make_shared<chaiscript::Module>();
  modulePtr->add(chaiscript::fun(&addC<int, const int>), "addC");
  return 0;
}

which generates in Visual c++ 2017RC the two errors:

C2528    "abstract declarator": pointer to reference is illegal   boxed_cast_helper.hpp 43    
C2440    "static_cast":  cannot convert from "const void *" to "const int &&(*)"   boxed_cast_helper.hpp 43

When I remove the rvalue-reference from the addC function everything works fine, i.e.

template<class TComp, class... TArgs>
void addC(TArgs&... params) {}
Jason Turner
@lefticus
Dec 05 2016 17:50
@StanEpp I don't have any support yet for r-value reference parameters. If I get the chance today I'll see what the possibilities are
@vovanre if you want to make print go somewhere else you can do a little trick like this:
global print = fun(val) {
  /* do something with val, like send it to a file, or call another func */
  // and maybe even echo it out to console too, by calling the 'old' version
  `print`(val);
}
StanEpp
@StanEpp
Dec 05 2016 18:05
Alright thanks for the information. :)
Jason Turner
@lefticus
Dec 05 2016 18:13
@StanEpp looking at it right now, it has me curious enough to make it my highest priority :)
Jason Turner
@lefticus
Dec 05 2016 18:21
@StanEpp oh, I have it working, proven with the move-only unique_ptr<> I feel compiled to add one more thing though before I call it done
StanEpp
@StanEpp
Dec 05 2016 18:50
This is great! Looking forward to the commit =)
Jason Turner
@lefticus
Dec 05 2016 19:07
I found it necessary to address the lack of support for unique_ptr for normal things also, so I'm adding in some workable support for it
Jason Turner
@lefticus
Dec 05 2016 21:09
@StanEpp committed
StanEpp
@StanEpp
Dec 05 2016 21:09
Thanks!
StanEpp
@StanEpp
Dec 05 2016 22:11
Does it need to worry me that when compiling the latest develop branch the compiler tells me that there is an integral constant overflow in the fnv1a_32 hash function?
Jason Turner
@lefticus
Dec 05 2016 23:57
@StanEpp which compiler?