thunk.h 474 Bytes
Newer Older
1
2
3
4
5
6
#ifndef __THUNK_H
#define __THUNK_H

#include "desc.h"
#include "code.h"

Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
7
typedef struct Thunk
8
9
10
11
12
13
14
15
16
17
{
	struct Desc* desc;
	union
	{
		int _int;
		double _real;	// TODO: move "real" out of here, too long 
		char _char;
		int _bool;
		struct CleanString* _string_ptr;
		//struct CleanString _string;
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
18
		Thunk* _args[];
19
	};
Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
20
} Thunk;
21
22

struct Thunk* createI(int i);
23
struct Thunk* createF(Desc* f, int nrargs);
24

Laszlo Domoszlai's avatar
Laszlo Domoszlai committed
25
26
Thunk* eval(Thunk* thunk);

27
28
29
void print(Thunk* thunk);

#endif // __THUNK_H