Section 8 of the Advanced Programming Guide has ten examples of adding UDFs. Here's the first one: 8.4.1 Euler’s Number This example demonstrates returning a mathematical constant, Euler’s number, from a user defined function. The AddUDF function call required in UserFunctions specifies that the CLIPS function name is e; the return value type is a float; the UDF does not expect any arguments; and the C implementation of the UDF is the function EulersNumber. void UserFunctions( Environment *env) {...
70x BPG updates
70x Do, iff, and other updates
70x Added factorial example
70x Defmodule bsave initialization fix
The linker handles references differently between files compiled as C and files compiled as C++. If you're using the make file that came with CLIPS, create the library using "make release_cpp". That will create the library using the g++ compiler. core % make . . . core % gcc -Wall -o main main.c -L. -lclips -lm core % g++ -Wall -o main main.c -L. -lclips -lm clang++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] Undefined symbols for architecture...
It's in the SVN repository for this project under the code tab: https://sourceforge.net/p/clipsrules/code/HEAD/tree/branches/70x/
If you're willing to compile the exectuables yourself and deal with some incomplete documentation, you can consider it to be a beta release. There's enough new functionality that I'm working on a companion book for it when I eventually do release it. The automatic goal generation doesn't support backtracking like Prolog (which I last used 40 years ago),, so I'm still exploring what can be done with it. It's really quite useful for systems that need to ask questions,, but I want to fully explore other...