|
If you want to experiment with embedding the NodeBrain interpreter in your
own program, you can use nb.c and various modules in the source distribution as
sample code.
Here's a trivial example.
#include <nb/nb.h>
int main(int argc,char *argv[]){
nbCELL context;
printf("hello\n");
// Start the NodeBrain interpreter
context=nbStart(argc,argv);
// Issue some commands
nbCmd(context,"assert a==x+y;",NB_CMDOPT_ECHO);
nbCmd(context,"define r1 on(a>4):show -cells",NB_CMDOPT_ECHO);
nbCmd(context,"assert x=2,y=3;",NB_CMDOPT_ECHO);
// Stop the interpreter
nbStop(context);
}
The NodeBrain Library manual describing the API needs a lot of work,
and the API will be unstable prior to a 1.0 release. So consider it experimental
only.
|