Picore

Provides LISP core functions: eval and apply. More...

Functions

celleval (cell *expression, cell *env)
 Evaluates one sexpression and returns the result. More...
 
cellapply (cell *fn, cell *args, cell *env, bool eval_args)
 Applies the function to the args in the environment. More...
 
cellpairlis (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. More...
 
cellassoc (cell *symbol, cell *env)
 Associates one symbol to one values in the environment. More...
 
cellevlis (cell *args, cell *env)
 Evaluates the cars of the list in the environment. It's called when a lambda is evaluated: first the list of the arguments of the lambda will be evaluated with this function. More...
 
cellevcon (cell *args, cell *env)
 Evaluates the cond-special form. More...
 
celleval_atom (cell *expression, cell *env)
 
celleval_atom_function (cell *expression, cell *env)
 
celleval_composed_function (cell *expression, cell *env)
 
celleval_macro (cell *expression, cell *env)
 
cellapply_atom_function (cell *fn, cell *args, cell *env, bool eval_args)
 
cellapply_composed_function (cell *fn, cell *args, cell *env, bool eval_args)
 
cellapply_lambda (cell *fn, cell *args, cell *env, bool eval_args)
 
cellapply_lasm (cell *fn, cell *args, cell *env, bool eval_args)
 
cellapply_label (cell *fn, cell *args, cell *env, bool eval_args)
 
cellapply_macro (cell *fn, cell *args, cell *env, bool eval_args)
 
celleval_lambda_and_apply (cell *fn, cell *args, cell *env, bool eval_args)
 

Detailed Description

Provides LISP core functions: eval and apply.

Function Documentation

cell* apply ( cell fn,
cell args,
cell env,
bool  eval_args 
)

Applies the function to the args in the environment.

Parameters
fnsexpression representing the function. Can be non-atomic
argslist of arguments
envlist of pairs symbol - value
eval_argstrue if the arguments should be evaluated. They should not be evaluated only when apllying a macro
Returns
cell* the result of the function applied to the arguments
cell* apply_atom_function ( cell fn,
cell args,
cell env,
bool  eval_args 
)
cell* apply_composed_function ( cell fn,
cell args,
cell env,
bool  eval_args 
)
cell* apply_label ( cell fn,
cell args,
cell env,
bool  eval_args 
)
cell* apply_lambda ( cell fn,
cell args,
cell env,
bool  eval_args 
)
cell* apply_lasm ( cell fn,
cell args,
cell env,
bool  eval_args 
)
cell* apply_macro ( cell fn,
cell args,
cell env,
bool  eval_args 
)
cell* assoc ( cell symbol,
cell env 
)

Associates one symbol to one values in the environment.

Parameters
symbolthe symbol to be associated
envthe environment where the value of the symbol is contained
Returns
cell* the value of the symbol in the environment
cell* eval ( cell expression,
cell env 
)

Evaluates one sexpression and returns the result.

Parameters
expressionthe sexpression to be evaluated
envlist of pairs symbol - value
Returns
cell* the expression evaluated in the environment
cell* eval_atom ( cell expression,
cell env 
)
cell* eval_atom_function ( cell expression,
cell env 
)
cell* eval_composed_function ( cell expression,
cell env 
)
cell* eval_lambda_and_apply ( cell fn,
cell args,
cell env,
bool  eval_args 
)
cell* eval_macro ( cell expression,
cell env 
)
cell* evcon ( cell args,
cell env 
)

Evaluates the cond-special form.

Parameters
argsthe list of the arguments: if the caar valuates to non-nill value the the value of the cond will be the evaluated cadar
envlist of pairs symbol - value
Returns
cell* result of the cond
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 list of the arguments of the lambda will be evaluated with this function.

Parameters
argsthe list of the arguments
envthe environment
Returns
cell* the list containing the valued cars
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.

Parameters
symbols_listlist containing the symbols
values_listlist containing the values. the order Matters: the first will be matched with the first symbol the second with the second symbol and so on
envthe environment to be extended
Returns
cell* the new environment