summaryrefslogtreecommitdiff
path: root/apl9.h
diff options
context:
space:
mode:
authorglenda <glenda@9front>2022-10-22 19:03:56 +0000
committerglenda <glenda@9front>2022-10-22 19:03:56 +0000
commit79ab1a4223d53bbdbffc55ae7f9740d953c57945 (patch)
tree65104abcf220f4774ab2b84a0d772c891a9dff17 /apl9.h
parent6a0d0638cdf510a9033fcd1e1a66daf636197a6f (diff)
Prepare for a namespace implementation at some point
Diffstat (limited to 'apl9.h')
-rw-r--r--apl9.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/apl9.h b/apl9.h
index 54d827b..87b65f4 100644
--- a/apl9.h
+++ b/apl9.h
@@ -24,6 +24,7 @@ typedef enum
AtypeRune,
AtypeMixed,
AtypeArray,
+ AtypeNamespace,
} arrayDataType;
typedef enum
@@ -59,6 +60,7 @@ typedef enum
/* Data types */
typedef struct Mixed Mixed;
+typedef struct Namespace Namespace;
typedef struct Array Array;
typedef struct Statement Statement;
typedef struct Operator Operator;
@@ -83,6 +85,12 @@ struct Mixed
};
};
+struct Namespace
+{
+ Rune *displayform;
+ Symtab *syms;
+};
+
#define GetRank(a) ((u8int)((a->info & 0x000000000000000F) >> 0))
#define GetType(a) ((u8int)((a->info & 0x00000000000000F0) >> 4))
#define GetStrand(a) ((u8int)((a->info & 0x0000000000000100) >> 8))
@@ -100,6 +108,7 @@ struct Array
Rune *runedata;
Mixed *mixeddata;
Array **arraydata;
+ Namespace **nsdata;
Array *prototype; /* only in use when size == 0 and type == AtypeArray */
};
uvlong size;
@@ -243,6 +252,7 @@ struct ThreadData
QLock lock;
Rendez newmail;
Array *name;
+ Array *ns;
};
struct Mail
@@ -271,6 +281,7 @@ Array *mkscalarint(vlong);
Array *mkscalarfloat(double);
Array *mkscalarrune(Rune);
Array *mkrunearray(Rune *);
+Array *mkscalarns(Namespace *);
Array *duparray(Array *);
Array *duparrayshape(Array *, int);
int simplearray(Array *);
@@ -489,4 +500,5 @@ extern opmonad hybridoperatordefs[]; /* hybrids.c */
extern int arrayalloccounts; /* memory.c */
extern int datumalloccounts; /* memory.c */
extern QuadnameDef quadnames[]; /* quadnames.c */
-extern int printprecision; /* print.c */ \ No newline at end of file
+extern int printprecision; /* print.c */
+extern Array *rootns; /* symbol.c */ \ No newline at end of file