mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
Stubs for vector type
This commit is contained in:
parent
c0858834e4
commit
f796ba740f
1 changed files with 6 additions and 1 deletions
|
@ -86,6 +86,7 @@ typedef long tag_type;
|
|||
#define port_tag 14
|
||||
#define boolean_tag 15
|
||||
#define cvar_tag 16
|
||||
#define vector_tag 17
|
||||
|
||||
#define nil NULL
|
||||
#define eq(x,y) (x == y)
|
||||
|
@ -170,6 +171,10 @@ typedef struct {tag_type tag; char *str;} string_type;
|
|||
typedef struct {tag_type tag; FILE *fp; int mode;} port_type;
|
||||
#define make_port(p,f,m) port_type p; p.tag = port_tag; p.fp = f; p.mode = m;
|
||||
|
||||
/* Vector type */
|
||||
|
||||
// TODO
|
||||
|
||||
/* Define cons type. */
|
||||
|
||||
typedef struct {tag_type tag; object cons_car,cons_cdr;} cons_type;
|
||||
|
@ -211,7 +216,7 @@ cons_type n; n.tag = cons_tag; n.cons_car = a; n.cons_cdr = d;
|
|||
|
||||
#define atom(x) ((x == NULL) || (((cons_type *) x)->tag != cons_tag))
|
||||
|
||||
/* Closure types. (I don't trust compilers to optimize vector refs.) */
|
||||
/* Closure types */
|
||||
|
||||
typedef struct {tag_type tag; function_type fn;} closure0_type;
|
||||
typedef struct {tag_type tag; function_type fn; object elt1;} closure1_type;
|
||||
|
|
Loading…
Add table
Reference in a new issue