6 ms·
Well if nothing has any arguments then yeah, it's basically the second version. but if you had arguments you end up with things like %foo(+A,-B) foo(A,42)
by Avshalom 5y ago
Well if nothing has any arguments then yeah, it's basically the second version.
but if you had arguments you end up with things like
%foo(+A,-B)
foo(A,42) :-
A < 10.
foo(A,24) :-
A >= 10.
foo(_,100).
which would be
bool foo(int *A, int *B){
if (*A < 10){
*B = 42;
}elseif (*A >= 10){
*B = 24;
}else{
*B = 100;
}
return true;
} /* my pointer knowledge is rusty though, so grain of salt */