[Commit] nickle/builtin toplevel.c,1.17,1.18
Keith Packard
commit at keithp.com
Mon Jul 21 16:22:13 PDT 2003
- Previous message: [Commit] nickle hash.c, NONE, 1.1 Makefile.am, 1.35, 1.36 array.c,
1.20, 1.21 compile.c, 1.139, 1.140 execute.c, 1.82,
1.83 file.c, 1.50, 1.51 gram.y, 1.124, 1.125 int.c, 1.19,
1.20 integer.c, 1.16, 1.17 natural.c, 1.21, 1.22 nickle.h,
1.105, 1.106 opcode.h, 1.24, 1.25 pretty.c, 1.62,
1.63 rational.c, 1.26, 1.27 string.c, 1.14, 1.15 struct.c,
1.21, 1.22 type.c, 1.55, 1.56 value.c, 1.43, 1.44 value.h,
1.88, 1.89
- Next message: [Commit] nickle gram.y, 1.125, 1.126 hash.c, 1.1, 1.2 lex.l, 1.68,
1.69 nickle.h, 1.106, 1.107 pretty.c, 1.63, 1.64 type.c, 1.56,
1.57 value.h, 1.89, 1.90
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: keithp
Update of /local/src/CVS/nickle/builtin
In directory home.keithp.com:/tmp/cvs-serv7368/builtin
Modified Files:
toplevel.c
Log Message:
Add hashes, fix subscript type printing
Index: toplevel.c
===================================================================
RCS file: /local/src/CVS/nickle/builtin/toplevel.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- toplevel.c 30 Jun 2003 04:53:43 -0000 1.17
+++ toplevel.c 21 Jul 2003 22:22:11 -0000 1.18
@@ -24,6 +24,7 @@
static const struct fbuiltin_0 funcs_0[] = {
{ do_getbyte, "getbyte", "i", "" },
{ do_time, "time", "i", "" },
+ { do_hash_new, "hash_new", "p", "" },
{ 0 }
};
@@ -71,6 +72,9 @@
{ do_xor, "xor", "i", "ii" },
{ do_setdims, "setdims", "v", "ApAi" },
{ do_setdim, "setdim", "v", "Api" },
+ { do_hash_get, "hash_get", "p", "pp" },
+ { do_hash_del, "hash_del", "v", "pp" },
+ { do_hash_test, "hash_test", "b", "pp" },
{ 0 }
};
@@ -79,6 +83,11 @@
{ 0 }
};
+ static const struct fbuiltin_3 funcs_3[] = {
+ { do_hash_set, "hash_set", "v", "ppp" },
+ { 0 }
+ };
+
static const struct fbuiltin_v funcs_v[] = {
{ do_imprecise, "imprecise", "R", "R.i" },
{ do_string_to_integer, "string_to_integer", "i", "s.i" },
@@ -88,6 +97,7 @@
BuiltinFuncs0 (/*parent*/ 0, funcs_0);
BuiltinFuncs1 (/*parent*/ 0, funcs_1);
BuiltinFuncs2 (/*parent*/ 0, funcs_2);
+ BuiltinFuncs3 (/*parent*/ 0, funcs_3);
BuiltinFuncs2J (/*parent*/ 0, funcs_2j);
BuiltinFuncsV (/*parent*/ 0, funcs_v);
EXIT ();
@@ -738,5 +748,33 @@
Value
do_hash (Value a)
{
- return ValueHash(a);
+ return ValueHash (a);
+}
+
+/* hash builtins (for testing) */
+Value do_hash_new (void)
+{
+ return NewHash (False, typePoly, typePoly);
+}
+
+Value do_hash_get (Value hv, Value key)
+{
+ return HashGet (hv, key);
+}
+
+Value do_hash_del (Value hv, Value key)
+{
+ HashDelete (hv, key);
+ return Void;
+}
+
+Value do_hash_test (Value hv, Value key)
+{
+ return HashTest (hv, key);
+}
+
+Value do_hash_set (Value hv, Value key, Value value)
+{
+ HashSet (hv, key, value);
+ return Void;
}
- Previous message: [Commit] nickle hash.c, NONE, 1.1 Makefile.am, 1.35, 1.36 array.c,
1.20, 1.21 compile.c, 1.139, 1.140 execute.c, 1.82,
1.83 file.c, 1.50, 1.51 gram.y, 1.124, 1.125 int.c, 1.19,
1.20 integer.c, 1.16, 1.17 natural.c, 1.21, 1.22 nickle.h,
1.105, 1.106 opcode.h, 1.24, 1.25 pretty.c, 1.62,
1.63 rational.c, 1.26, 1.27 string.c, 1.14, 1.15 struct.c,
1.21, 1.22 type.c, 1.55, 1.56 value.c, 1.43, 1.44 value.h,
1.88, 1.89
- Next message: [Commit] nickle gram.y, 1.125, 1.126 hash.c, 1.1, 1.2 lex.l, 1.68,
1.69 nickle.h, 1.106, 1.107 pretty.c, 1.63, 1.64 type.c, 1.56,
1.57 value.h, 1.89, 1.90
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commit
mailing list