picore.h
Go to the documentation of this file.
1 
9 
10 #ifndef PICORE_H
11 #define PICORE_H
12 #include "pilisp.h"
13 
14 // ==================== Core functions ====================
15 
23 cell *eval(cell *expression, cell *env);
24 
35 cell *apply(cell *fn, cell *args, cell *env, bool eval_args);
36 
48 cell *pairlis(cell *symbols_list, cell *values_list, cell *env);
49 
57 cell *assoc(cell *symbol, cell *env);
58 
68 cell *evlis(cell *args, cell *env);
69 
79 cell *evcon(cell *args, cell *env);
80 
81 // ==================== Support functions ====================
82 cell *eval_atom(cell *expression, cell *env);
83 cell *eval_atom_function(cell *expression, cell *env);
84 cell *eval_composed_function(cell *expression, cell *env);
85 cell *eval_macro(cell *expression, cell *env);
86 
87 cell *apply_atom_function(cell *fn, cell *args, cell *env, bool eval_args);
88 cell *apply_composed_function(cell *fn, cell *args, cell *env, bool eval_args);
89 cell *apply_lambda(cell *fn, cell *args, cell *env, bool eval_args);
90 cell *apply_lasm(cell *fn, cell *args, cell *env, bool eval_args);
91 cell *apply_label(cell *fn, cell *args, cell *env, bool eval_args);
92 cell *apply_macro(cell *fn, cell *args, cell *env, bool eval_args);
93 cell *eval_lambda_and_apply(cell *fn, cell *args, cell *env, bool eval_args);
94 
95 #endif // !PICORE_H
cell * apply_macro(cell *fn, cell *args, cell *env, bool eval_args)
Definition: picore.c:248
cell * eval_atom_function(cell *expression, cell *env)
Definition: picore.c:43
cell * pairlis(cell *symbols_list, cell *values_list, cell *env)
Creates a new list of pairs symbol-values starting from another. It's used to extend one environment...
Definition: picore.c:127
cell * apply_atom_function(cell *fn, cell *args, cell *env, bool eval_args)
Definition: picore.c:162
cell * apply_lasm(cell *fn, cell *args, cell *env, bool eval_args)
Definition: picore.c:215
cell * apply(cell *fn, cell *args, cell *env, bool eval_args)
Applies the function to the args in the environment.
Definition: picore.c:92
cell * eval_atom(cell *expression, cell *env)
Definition: picore.c:15
cell * env(cell *arg)
Definition: pibuiltin.c:907
Basic Lisp entity.
Definition: picell.h:44
cell * apply_lambda(cell *fn, cell *args, cell *env, bool eval_args)
Definition: picore.c:204
cell * assoc(cell *symbol, cell *env)
Associates one symbol to one values in the environment.
Definition: picore.c:145
cell * eval_lambda_and_apply(cell *fn, cell *args, cell *env, bool eval_args)
Definition: picore.c:258
cell * eval_macro(cell *expression, cell *env)
Definition: picore.c:79
cell * eval_composed_function(cell *expression, cell *env)
Definition: picore.c:65
cell * evlis(cell *args, cell *env)
Evaluates the cars of the list in the environment. It's called when a lambda is evaluated: first the ...
Definition: picore.c:99
cell * eval(cell *expression, cell *env)
Evaluates one sexpression and returns the result.
Definition: picore.c:4
cell * apply_composed_function(cell *fn, cell *args, cell *env, bool eval_args)
Definition: picore.c:188
cell * apply_label(cell *fn, cell *args, cell *env, bool eval_args)
Definition: picore.c:239
cell * evcon(cell *args, cell *env)
Evaluates the cond-special form.
Definition: picore.c:107