[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 56/61: Minor GOOPS cleanups
From: |
Andy Wingo |
Subject: |
[Guile-commits] 56/61: Minor GOOPS cleanups |
Date: |
Thu, 22 Jan 2015 18:53:21 +0000 |
wingo pushed a commit to branch wip-goops-refactor
in repository guile.
commit dc062a48d45d5fc63dd1b13d3600cbe8406d6d7a
Author: Andy Wingo <address@hidden>
Date: Mon Jan 19 15:57:23 2015 +0100
Minor GOOPS cleanups
* module/oop/goops.scm: Minor commenting fixes.
---
module/oop/goops.scm | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index 6e4cd4b..cf8eda7 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -247,9 +247,10 @@
;;; class-index-flags. `vtable-flag-vtable' indicates that instances of
;;; a vtable are themselves vtables, and `vtable-flag-validated'
;;; indicates that the struct's layout has been validated. goops.c
-;;; defines a couple of additional flags: one to indicate that a vtable
-;;; is actually a class, and one to indicate that the class is "valid",
-;;; meaning that it hasn't been redefined.
+;;; defines a few additional flags: one to indicate that a vtable is
+;;; actually a class, one to indicate that the class is "valid" (meaning
+;;; that it hasn't been redefined), and one to indicate that instances
+;;; of a class are slot definition objects (<slot> instances).
;;;
(define vtable-flag-goops-metaclass
(logior vtable-flag-vtable vtable-flag-goops-class))
@@ -269,6 +270,10 @@
(define-inlinable (class? obj)
(class-has-flags? (struct-vtable obj) vtable-flag-goops-metaclass))
+(define-inlinable (slot? obj)
+ (and (struct? obj)
+ (class-has-flags? (struct-vtable obj) vtable-flag-goops-slot)))
+
(define-inlinable (instance? obj)
(class-has-flags? (struct-vtable obj) vtable-flag-goops-class))
@@ -377,7 +382,6 @@ subclasses of @var{c}."
;;; more of the protocol. Again, the CPL and class hierarchy slots
;;; remain uninitialized.
;;;
-
(define* (get-keyword key l #:optional default)
"Determine an associated value for the keyword @var{key} from the list
@var{l}. The list @var{l} has to consist of an even number of elements,
@@ -426,10 +430,6 @@ followed by its associated value. If @var{l} does not
hold a value for
(struct-set! <slot> class-index-redefined #f)
<slot>)))
-(define-inlinable (slot? obj)
- (and (struct? obj)
- (class-has-flags? (struct-vtable obj) vtable-flag-goops-slot)))
-
(define-syntax-rule (define-slot-accessor name docstring %name field)
(begin
(define-syntax-rule (%name obj)
- [Guile-commits] 43/61: `match' refactor in goops.scm, (continued)
- [Guile-commits] 43/61: `match' refactor in goops.scm, Andy Wingo, 2015/01/22
- [Guile-commits] 40/61: when and unless for one-armed ifs in goops.scm, Andy Wingo, 2015/01/22
- [Guile-commits] 44/61: GOOPS class slot indices defined as inline values, Andy Wingo, 2015/01/22
- [Guile-commits] 47/61: change-object-class refactor, Andy Wingo, 2015/01/22
- [Guile-commits] 45/61: Manipulate GOOPS vtable flags from Scheme, for speed, Andy Wingo, 2015/01/22
- [Guile-commits] 41/61: More GOOPS cleanups, Andy Wingo, 2015/01/22
- [Guile-commits] 48/61: GOOPS: Deprecate "using-class" procs like slot-ref-using-class, Andy Wingo, 2015/01/22
- [Guile-commits] 46/61: slot-ref, slot-set! et al bypass "using-class" variants, Andy Wingo, 2015/01/22
- [Guile-commits] 50/61: Beginnings of <slot> slot definition class, Andy Wingo, 2015/01/22
- [Guile-commits] 52/61: Use a vtable bit to mark <slot> instances, Andy Wingo, 2015/01/22
- [Guile-commits] 56/61: Minor GOOPS cleanups,
Andy Wingo <=
- [Guile-commits] 55/61: Optimize %initialize-object, Andy Wingo, 2015/01/22
- [Guile-commits] 49/61: The GOOPS "unbound" value is a unique pair, Andy Wingo, 2015/01/22
- [Guile-commits] 53/61: Inline helpers into slot-ref, slot-set!, etc, Andy Wingo, 2015/01/22
- [Guile-commits] 58/61: Update (oop goops save) for <slot> objects, Andy Wingo, 2015/01/22
- [Guile-commits] 60/61: Fast generic function dispatch without calling `compile' at runtime, Andy Wingo, 2015/01/22
- [Guile-commits] 57/61: Fix foreign objects for removal of getters-n-setters, Andy Wingo, 2015/01/22
- [Guile-commits] 54/61: Inline internal slot accessors, Andy Wingo, 2015/01/22
- [Guile-commits] 61/61: Simplify GOOPS effective method cache format, Andy Wingo, 2015/01/22
- [Guile-commits] 59/61: GOOPS cosmetics, Andy Wingo, 2015/01/22
- [Guile-commits] 51/61: Introduce <slot> objects in GOOPS, Andy Wingo, 2015/01/22