Archived
1
0
Fork 0
This repository has been archived on 2023-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
lispy/lval/operations.h

33 lines
702 B
C
Raw Permalink Normal View History

2018-06-07 19:10:53 -04:00
#ifndef LVAL_OPERATIONS
#define LVAL_OPERATIONS
#include "../mpc.h"
#include "base.h"
2018-06-09 19:30:24 -04:00
#include "environment.h"
2018-06-07 19:10:53 -04:00
// Constructor for symbol data type
2018-06-07 19:10:53 -04:00
lval* lval_sym(char* s);
/*
Methods to read (parse AST), evaluate,
copy, and delete lval structures
2018-06-07 19:10:53 -04:00
*/
lval* lval_read(mpc_ast_t* t);
2018-06-09 19:30:24 -04:00
lval* lval_eval(lenv* e, lval* v);
2018-06-07 19:10:53 -04:00
void lval_del(lval* v);
lval* lval_copy(lval* v);
2018-06-07 19:10:53 -04:00
2018-06-09 19:30:24 -04:00
// Math libraries
lval* builtin_add(lenv* e, lval* a);
lval* builtin_sub(lenv* e, lval* a);
lval* builtin_mul(lenv* e, lval* a);
lval* builtin_div(lenv* e, lval* a);
lval* builtin_pow(lenv* e, lval* a);
lval* builtin_mod(lenv* e, lval* a);
lval* builtin_min(lenv* e, lval* a);
lval* builtin_max(lenv* e, lval* a);
2018-06-07 19:10:53 -04:00
#endif