CompareNumber(CompareNumberQT, ArithmeticTerm, ArithmeticTerm),
EraseBall,
Fail,
- GetArg,
+ GetArgCall,
+ GetArgExecute,
GetBall,
GetCurrentBlock,
GetCutPoint(RegType),
functor_execute!(), // functor/3, 146.
is_integer!(temp_v!(1)), // integer/1, 147.
proceed!(),
- get_arg!(), // get_arg/3, 149.
+ get_arg_execute!(), // get_arg/3, 149.
try_me_else!(10), // arg/3, 150.
allocate!(4),
fact![get_var_in_fact!(perm_v!(1), 1),
neck_cut!(),
query![put_value!(temp_v!(6), 2),
put_value!(temp_v!(5), 3)],
- arg_execute!(),
+ get_arg_execute!(),
trust_me!(),
allocate!(5),
fact![get_list!(Level::Shallow, temp_v!(1)),
query![put_value!(perm_v!(5), 1),
put_value!(perm_v!(3), 2),
put_value!(temp_v!(5), 3)],
- arg_call!(),
+ get_arg_call!(),
add!(ArithmeticTerm::Reg(perm_v!(5)),
ArithmeticTerm::Number(rc_integer!(1)),
1),
&ControlInstruction::ExecuteN(arity) =>
write!(f, "execute_N {}", arity),
&ControlInstruction::FunctorCall =>
- write!(f, "call_functor"),
+ write!(f, "functor_call"),
&ControlInstruction::FunctorExecute =>
- write!(f, "execute_functor"),
+ write!(f, "functor_execute"),
&ControlInstruction::Deallocate =>
write!(f, "deallocate"),
&ControlInstruction::Execute(ref name, arity) =>
write!(f, "erase_ball"),
&BuiltInInstruction::Fail =>
write!(f, "false"),
- &BuiltInInstruction::GetArg =>
- write!(f, "get_arg X1, X2, X3"),
+ &BuiltInInstruction::GetArgCall =>
+ write!(f, "get_arg_call X1, X2, X3"),
+ &BuiltInInstruction::GetArgExecute =>
+ write!(f, "get_arg_execute X1, X2, X3"),
&BuiltInInstruction::GetBall =>
write!(f, "get_ball X1"),
&BuiltInInstruction::GetCurrentBlock =>
return EvalSession::from(e);
};
- print_code(&code);
-
if !code.is_empty() {
if let Some(name) = tl.name() {
wam.add_user_code(name, tl.arity(), code)
self.unify(a, Addr::Con(Constant::Number(result)));
self.p += 1;
},
- &BuiltInInstruction::GetArg =>
+ &BuiltInInstruction::GetArgCall =>
+ try_or_fail!(self, {
+ let val = self.try_get_arg();
+ self.p += 1;
+ val
+ }),
+ &BuiltInInstruction::GetArgExecute =>
try_or_fail!(self, {
let val = self.try_get_arg();
self.p = self.cp;
)
}
-macro_rules! arg_execute {
- () => (
- Line::Control(ControlInstruction::ArgExecute)
- )
-}
-
-macro_rules! arg_call {
- () => (
- Line::Control(ControlInstruction::ArgCall)
- )
-}
-
macro_rules! unify_value {
($r:expr) => (
FactInstruction::UnifyValue($r)
)
}
-macro_rules! get_arg {
+macro_rules! get_arg_call {
+ () => (
+ Line::BuiltIn(BuiltInInstruction::GetArgCall)
+ )
+}
+
+macro_rules! get_arg_execute {
() => (
- Line::BuiltIn(BuiltInInstruction::GetArg)
+ Line::BuiltIn(BuiltInInstruction::GetArgExecute)
)
}