File: lisp.H

package info (click to toggle)
tela 1.28-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 6,596 kB
  • ctags: 5,519
  • sloc: ansic: 14,013; cpp: 13,376; lex: 1,651; fortran: 1,048; yacc: 834; sh: 715; makefile: 464
file content (40 lines) | stat: -rw-r--r-- 1,071 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * This file is part of tela the Tensor Language.
 * Copyright (c) 1994-1996 Pekka Janhunen
 */

#ifdef __GNUC__
#  pragma interface
#endif
#ifndef LISP_H
#include "tree.H"

inline int Atom(Tnode*x) {return !(x->list);}

Tnode* List(Tfunc h, Tnode*a);
Tnode* List(Tfunc h, Tnode*a, Tnode*b);
Tnode* List(Tfunc h, Tnode*a, Tnode*b, Tnode*c);

inline Tnode* List(Tnode*a) {return List(FLIST,a);}
inline Tnode* List(Tnode*a, Tnode*b) {return List(FLIST,a,b);}
inline Tnode* List(Tnode*a, Tnode*b, Tnode*c) {return List(FLIST,a,b,c);}

inline Tfunc Head(Tnode*L) {return L->FunctionValue();}
inline Tnode* First(Tnode*L) {return L->list;}
inline Tnode* Second(Tnode*L) {return L->list->next;}
inline Tnode* Third(Tnode*L) {return L->list->next->next;}
inline Tnode* Fourth(Tnode*L) {return L->list->next->next->next;}
inline Tnode* Fifth(Tnode*L) {return L->list->next->next->next->next;}

Tnode* Nth(Tnode*L, int N);

int Length(Tnode*L);

Tnode* CopyList(Tnode*L);

Tnode* Append(Tnode*L1, Tnode*L2);
Tnode* Append(Tnode*L1, Tnode*L2, Tnode*L3);

#define LISP_H

#endif