-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwrapper.h
54 lines (37 loc) · 820 Bytes
/
wrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef WRAPPER
#define WRAPPER
#include <string>
// TODO: shift definitions into header once more complete.
struct atom;
struct term;
struct variable;
struct nil;
// atom func decls
std::string atom_to_str(atom at);
atom term_to_atom(term t);
atom find_atom(const char * atom_name);
template<typename T>
atom mk_atom(T);
template<>
atom mk_atom<const char *>(const char *str);
template<>
atom mk_atom<nil>(nil);
// term func decls
template<typename T>
term mk_term(T);
template<>
term mk_term<long>(long l);
template<>
term mk_term<int>(int l);
template<>
term mk_term<double>(double d);
template<>
term mk_term<atom>(atom a);
/** usage:
* term my_var_term = mk_term( variable { } );
* variable is just a phantom/tag.
*/
template<>
term mk_term<variable>(variable v);
#endif
// WRAPPER