#ifndef PEBBLISP_H #define PEBBLISP_H #include "env.h" #include "object.h" struct Slice { const char* text; unsigned char length; }; typedef struct Result { Object obj; struct Slice* slices; } Result; Object eval(const Object* obj, struct Environment* env); Result parse(struct Slice* slices); Result readSeq(struct Slice* slices); Result parseAtom(struct Slice* slice); Object parseEval(const char* input, struct Environment* env); void evalForms(Object* destList, const Object* src, struct Environment* env); void copySlice(char* dest, struct Slice* src); Object evalLambdaArgs(const Object* arg_forms); Object listEvalLambda(Object* lambda, const Object* remaining, struct Environment* env); // Slices void copySlice(char* dest, struct Slice* src); void debugSlice(struct Slice* s); #define BASIC_OP(_name) \ Object _name(Object obj1, Object obj2, struct Environment *env); BASIC_OP(add); BASIC_OP(sub); BASIC_OP(mul); BASIC_OP(dvi); BASIC_OP(mod); BASIC_OP(equ); BASIC_OP(gth); BASIC_OP(lth); BASIC_OP(and); BASIC_OP(or); #undef BASIC_OP Object catObjects(const Object obj1, const Object obj2, struct Environment* env); Object filter(Object obj1, Object obj2, struct Environment* env); Object append(Object list, Object newElement, struct Environment* env); Object prepend(Object list, Object newElement, struct Environment* env); Object at(Object index, Object list, struct Environment* env); Object rest(Object list, Object ignore, struct Environment* env); Object reverse(Object _list, Object ignore, struct Environment* ignore2); Object isNum(Object test, Object ignore, struct Environment* ignore2); Object isString(Object test, Object ignore, struct Environment* ignore2); Object isErr(Object test, Object ignore, struct Environment* ignore2); Object charAt(Object string, Object at, struct Environment* ignore); Object charVal(Object test, Object ignore, struct Environment* ignore2); Object print(Object p, Object ignore, struct Environment* ignore2); Object pChar(Object c, Object i1, struct Environment* i2); Object printEnvO(Object i1, Object i2, struct Environment* env); Object parseEvalO(Object text, Object ignore, struct Environment* env); Object possessive(Object structo, Object field, struct Environment* env); #ifdef STANDALONE Object takeInput(Object i1, Object i2, struct Environment* i3); Object systemCall(Object call, Object _, struct Environment* i3); Object loadFile(Object filename, Object _, struct Environment* env); Object startServer(Object path, Object textFunc, struct Environment* env); Object addRouteO(Object path, Object textFunc, struct Environment* env); #endif #endif