Article View: comp.lang.prolog
Article #1139SBProlog to C interface
From: paolo ciancarini
Date: Thu, 30 Aug 1990 19:37
Date: Thu, 30 Aug 1990 19:37
43 lines
1501 bytes
1501 bytes
I need help with parameter passing convention in SBProlog.
The procedural interface is poorly documented,
and examples provided are not useful for me.
I have to implement in C a predicate send/3
send(In_Atom1, In_Atom2, InAtom3)
that is always successful.
I want to implement send/3 with a C program.
I have a C file that contains a procedure
send(a,b,c)
char *a, *b, *c; % a,b,c: input
I added a dummy envelope for my procedure
(as requested by SBProlog)
b_SEND()
{
register LONG op1,op2,op3;
register LONG_PTR top;
op1 = reg[1]; DEREF(op1);
op2 = reg[2]; DEREF(op2);
op3 = reg[3]; DEREF(op3);
send(op1,op2,op3);
}
I follow the instructions given in the SB manual, but when I call
send/3 from inside Prolog I obtain a msg
#builtin 0 is not implemented
and the interpreter aborts!.
Moreover, it seems that my interpreter does not
support the builtin '_$builtin'/1, while the manual
says that it is an online predicate.
What am I missing?
Paolo Ciancarini
Technical Details
Message-ID:
<25945@cs.yale.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cs.yale.edu!ciancarini-paoloShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cs.yale.edu!ciancarini-paolo From: ciancarini-paolo@cs.yale.edu (paolo ciancarini) Newsgroups: comp.lang.prolog Subject: SBProlog to C interface Message-ID: <25945@cs.yale.edu> Date: 30 Aug 90 19:37:00 GMT Sender: news@cs.yale.edu Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Lines: 43 Nntp-Posting-Host: poe.systemsy.cs.yale.edu Originator: cianca@poe.CS.Yale.Edu