summaryrefslogtreecommitdiff
path: root/libguile/smob.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-01-06 22:16:57 +0100
committerAndy Wingo <wingo@pobox.com>2010-01-07 23:49:39 +0100
commitcc7005bc371ee104c368dbb894eb4f8b7a86d64a (patch)
tree8d4e17497cf6b11b9f22e528efcf9b29b51cba2d /libguile/smob.c
parent6c2961a01142c7ba9fc03a410004dd696e9208cd (diff)
downloadguile-cc7005bc371ee104c368dbb894eb4f8b7a86d64a.tar.gz
remove scm_tc7_gsubr
* libguile/tags.h (scm_tc7_gsubr): Return to the pool of unused tc7s, as there are no more gsubrs. Yay :) * libguile/programs.h (SCM_F_PROGRAM_IS_PRIMITIVE): (SCM_PROGRAM_IS_PRIMITIVE): New flag and accessor. * libguile/gsubr.c (create_gsubr): * libguile/snarf.h (SCM_STATIC_PROGRAM): Give subrs a PRIMITIVE flag. * libguile/smob.h: * libguile/smob.c (scm_i_smob_arity): New internal procedure. Uses the old GSUBR type macros, local to the file. * libguile/procprop.c (scm_i_procedure_arity): Call out to scm_i_smob_arity, and remove a gsubr case. * libguile/gc.c (scm_i_tag_name): * libguile/evalext.c (scm_self_evaluating_p): * libguile/goops.c (scm_class_of): * libguile/vm.c (apply_foreign): * libguile/hash.c (scm_hasher): * libguile/debug.c (scm_procedure_name): * libguile/print.c (iprin1): Remove gsubr cases. * libguile/gsubr.h (SCM_PRIMITIVE_P): Fix to work with the new VM program regimen. (SCM_GSUBR_TYPE, SCM_GSUBR_MAKTYPE, SCM_GSUBR_MAX, SCM_GSUBR_REQ) (SCM_GSUBR_OPT, SCM_GSUBR_REST): Remove these macros, that are no longer useful. * libguile/gsubr.c (scm_i_gsubr_apply, scm_i_gsubr_apply_list) (scm_i_gsubr_apply_array): Remove internal gsubr application functions.
Diffstat (limited to 'libguile/smob.c')
-rw-r--r--libguile/smob.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/libguile/smob.c b/libguile/smob.c
index d96a0439c..037164bc2 100644
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2003, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -17,6 +17,13 @@
*/
+#define SCM_GSUBR_MAKTYPE(req, opt, rst) ((req)|((opt)<<4)|((rst)<<8))
+#define SCM_GSUBR_MAX 33
+#define SCM_GSUBR_REQ(x) ((long)(x)&0xf)
+#define SCM_GSUBR_OPT(x) (((long)(x)&0xf0)>>4)
+#define SCM_GSUBR_REST(x) ((long)(x)>>8)
+
+
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -586,6 +593,21 @@ scm_i_finalize_smob (GC_PTR ptr, GC_PTR data)
free_smob (smob);
}
+int
+scm_i_smob_arity (SCM proc, int *req, int *opt, int *rest)
+{
+ if (SCM_SMOB_APPLICABLE_P (proc))
+ {
+ int type = SCM_SMOB_DESCRIPTOR (proc).gsubr_type;
+ *req = SCM_GSUBR_REQ (type);
+ *opt = SCM_GSUBR_OPT (type);
+ *rest = SCM_GSUBR_REST (type);
+ return 1;
+ }
+ else
+ return 0;
+}
+
void
scm_smob_prehistory ()