示例#1
0
 inline int int_value(ObjP p)
 {
     if (is_object(p))
     {
         Integer* integer = to_object(p)->cast_integer();
         return integer->int_value();
     }
     else
         if (is_fixnum(p))
             return fixnum_to_int(p);
     throw new Exception("bad_integer", p);
 }
示例#2
0
int main(int argc, char const *argv[])
{
	SparseStack ss_test;
	Integer index1(1);
	Integer context1(19);

	Integer index2(10);
	Integer context2(29);

	ss_test.push(index1, &context1);
	ss_test.push(index2, &context2);

	Integer tempi(6);
	Integer *tempc = (Integer *)ss_test.mapvalue(tempi);

	cout << "tempc: " << tempc->int_value() << endl;
	return 0;
}