[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/61: Remove scm_assert_bound
From: |
Andy Wingo |
Subject: |
[Guile-commits] 04/61: Remove scm_assert_bound |
Date: |
Thu, 22 Jan 2015 18:52:58 +0000 |
wingo pushed a commit to branch wip-goops-refactor
in repository guile.
commit a4626f02dd28d263f36a8689bfb96f8fb9c3e8ac
Author: Andy Wingo <address@hidden>
Date: Tue Jan 6 14:54:44 2015 -0500
Remove scm_assert_bound
* libguile/goops.c (scm_assert_bound): Remove unexported unused helper.
* module/oop/goops.scm (make-generic-bound-check-getter): Change
assert-bound use to use `unbound?'.
---
libguile/goops.c | 13 -------------
module/oop/goops.scm | 6 +++++-
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/libguile/goops.c b/libguile/goops.c
index cb33217..ab244ed 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -175,7 +175,6 @@ SCM scm_i_smob_class[SCM_I_MAX_SMOB_TYPE_COUNT];
static SCM scm_make_unbound (void);
static SCM scm_unbound_p (SCM obj);
-static SCM scm_assert_bound (SCM value, SCM obj);
static SCM scm_sys_bless_applicable_struct_vtables_x (SCM applicable,
SCM setter);
static SCM scm_sys_bless_pure_generic_vtable_x (SCM vtable);
@@ -717,18 +716,6 @@ SCM_DEFINE (scm_unbound_p, "unbound?", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE (scm_assert_bound, "assert-bound", 2, 0, 0,
- (SCM value, SCM obj),
- "Return @var{value} if it is bound, and invoke the\n"
- "@var{slot-unbound} method of @var{obj} if it is not.")
-#define FUNC_NAME s_scm_assert_bound
-{
- if (SCM_GOOPS_UNBOUNDP (value))
- return scm_call_1 (SCM_VARIABLE_REF (var_slot_unbound), obj);
- return value;
-}
-#undef FUNC_NAME
-
/** Utilities **/
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index 70edcfe..5068d14 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -1950,7 +1950,11 @@
#:slot-definition slotdef)))
(define (make-generic-bound-check-getter proc)
- (lambda (o) (assert-bound (proc o) o)))
+ (lambda (o)
+ (let ((val (proc o)))
+ (if (unbound? val)
+ (slot-unbound o)
+ val))))
;;; Pre-generate getters and setters for the first 20 slots.
(define-syntax define-standard-accessor-method
- [Guile-commits] branch wip-goops-refactor updated (def60ff -> c2ff33b), Andy Wingo, 2015/01/22
- [Guile-commits] 03/61: Remove scm_at_assert_bound_ref, Andy Wingo, 2015/01/22
- [Guile-commits] 06/61: More unused code removal in GOOPS, Andy Wingo, 2015/01/22
- [Guile-commits] 07/61: Remove unused union scm_t_debug_info, Andy Wingo, 2015/01/22
- [Guile-commits] 08/61: More goops.c cleanups, and fix a security issue, Andy Wingo, 2015/01/22
- [Guile-commits] 16/61: Goops slot-unbound / slot-missing cleanups, Andy Wingo, 2015/01/22
- [Guile-commits] 13/61: <class> accessors implemented in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 14/61: Port method and generic accessors to Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 04/61: Remove scm_assert_bound,
Andy Wingo <=
- [Guile-commits] 20/61: Remove scm_c_extend_primitive_generic, Andy Wingo, 2015/01/22
- [Guile-commits] 02/61: Remove hashset slots from GOOPS classes, Andy Wingo, 2015/01/22
- [Guile-commits] 05/61: Remove private var_no_applicable_method capture, Andy Wingo, 2015/01/22
- [Guile-commits] 11/61: Statically compute offsets for slots of <class> in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 10/61: Refactor to <class> slot computation, Andy Wingo, 2015/01/22
- [Guile-commits] 09/61: Remove GOOPS random state, Andy Wingo, 2015/01/22
- [Guile-commits] 23/61: Deprecate scm_get_keyword, Andy Wingo, 2015/01/22
- [Guile-commits] 18/61: Remove TEST_CHANGE_CLASS, Andy Wingo, 2015/01/22
- [Guile-commits] 17/61: Remove pure-generic?, Andy Wingo, 2015/01/22
- [Guile-commits] 25/61: Re-use the vtable "size" field for GOOPS nfields, Andy Wingo, 2015/01/22