[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/06: Minor GOOPS cleanups
From: |
Andy Wingo |
Subject: |
[Guile-commits] 01/06: Minor GOOPS cleanups |
Date: |
Wed, 21 Jan 2015 14:22:59 +0000 |
wingo pushed a commit to branch wip-goops-refactor
in repository guile.
commit d706407cfefed9ef741941b368f3f72600fe905a
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 a85a5cb..374c214 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -246,9 +246,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))
@@ -268,6 +269,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))
@@ -376,7 +381,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,
@@ -425,10 +429,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] branch wip-goops-refactor updated (9eac2c6 -> 39f3232), Andy Wingo, 2015/01/21
- [Guile-commits] 01/06: Minor GOOPS cleanups,
Andy Wingo <=
- [Guile-commits] 06/06: Fast generic function dispatch without calling `compile' at runtime, Andy Wingo, 2015/01/21
- [Guile-commits] 03/06: Fix foreign objects for removal of getters-n-setters, Andy Wingo, 2015/01/21
- [Guile-commits] 05/06: GOOPS cosmetics, Andy Wingo, 2015/01/21
- [Guile-commits] 04/06: Update (oop goops save) for <slot> objects, Andy Wingo, 2015/01/21
- [Guile-commits] 02/06: Keywords have a tc7, Andy Wingo, 2015/01/21