mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Add LISP interpreter
This commit is contained in:
parent
4f98ad1054
commit
d31bebdd2d
84 changed files with 9081 additions and 0 deletions
47
tool/plinko/lib/tree.h
Normal file
47
tool/plinko/lib/tree.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
#ifndef COSMOPOLITAN_TOOL_PLINKO_LIB_TREE_H_
|
||||
#define COSMOPOLITAN_TOOL_PLINKO_LIB_TREE_H_
|
||||
#include "tool/plinko/lib/cons.h"
|
||||
#include "tool/plinko/lib/plinko.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
int PutTree(int, int, int);
|
||||
int GetTree(int, int);
|
||||
int GetTreeCount(int, int, int *);
|
||||
int Nod(int, int, int, int);
|
||||
|
||||
forceinline pureconst int Key(int E) {
|
||||
return E < 0 ? Car(E) : E;
|
||||
}
|
||||
|
||||
forceinline pureconst int Val(int E) {
|
||||
return E < 0 ? Cdr(E) : E;
|
||||
}
|
||||
|
||||
forceinline pureconst int Ent(int N) {
|
||||
return Car(Car(N));
|
||||
}
|
||||
|
||||
forceinline pureconst int Chl(int N) {
|
||||
return Cdr(Car(N));
|
||||
}
|
||||
|
||||
forceinline pureconst int Lit(int N) {
|
||||
return Car(Chl(N));
|
||||
}
|
||||
|
||||
forceinline pureconst int Rit(int N) {
|
||||
return Cdr(Chl(N));
|
||||
}
|
||||
|
||||
forceinline pureconst int Red(int N) {
|
||||
return Cdr(N);
|
||||
}
|
||||
|
||||
forceinline int Bkn(int N) {
|
||||
return Red(N) ? Cons(Car(N), 0) : N;
|
||||
}
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_TOOL_PLINKO_LIB_TREE_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue