callable library
Posted: 10 Jan 2012, 10:41
From reading the documentation for c++ clients I got the impression that assignment would work automagicaly with the reference counting behind the scenes. So it was somewhat surprising to see this eat up memory rather fast.
Shouldn't the memory for the old polytope be freed each loop iteration or am I misusing perl::Objects here?
I have another totally unrelated question. How can I use the return value of a script from the callable library? I tried
with a trivial script like
but accessing any of p's attributes will result in a "Can't call method "type" on an undefined value" exception at runtime.
Code: Select all
polymake::Main m;
m.set_application("polytope");
pm::perl::Scope s = m.newScope();
pm::perl::Object p;
while(1){
CallPolymakeFunction("rand_sphere", 20, 200) >> p;
}
I have another totally unrelated question. How can I use the return value of a script from the callable library? I tried
Code: Select all
CallPolymakeFunction("script", "/pathtoscript/simple.pl") >> p;
Code: Select all
use application "polytope";
cube(3);