[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 58/88: GOOPS utils module cleanups
From: |
Andy Wingo |
Subject: |
[Guile-commits] 58/88: GOOPS utils module cleanups |
Date: |
Fri, 23 Jan 2015 15:25:51 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 06d54b3f700b7da0540a707d6e4c26475622cb74
Author: Andy Wingo <address@hidden>
Date: Mon Jan 12 21:40:29 2015 +0100
GOOPS utils module cleanups
* module/oop/goops.scm (make-class): Inline find-duplicate to its use
site.
* module/oop/goops/util.scm (improper->proper): Remove unused function.
(any, every): Don't re-export these from SRFI-1; users can get them
from SRFI-1 directly.
---
module/oop/goops.scm | 8 ++++++++
module/oop/goops/util.scm | 19 +------------------
2 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index 543acff..64c3d11 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -1183,6 +1183,14 @@ followed by its associated value. If @var{l} does not
hold a value for
;;;
(define (make-class supers slots . options)
+ (define (find-duplicate l)
+ (match l
+ (() #f)
+ ((head . tail)
+ (if (memq head tail)
+ head
+ (find-duplicate tail)))))
+
(let* ((name (get-keyword #:name options (make-unbound)))
(supers (if (not (or-map (lambda (class)
(memq <object>
diff --git a/module/oop/goops/util.scm b/module/oop/goops/util.scm
index fa48645..8b48f98 100644
--- a/module/oop/goops/util.scm
+++ b/module/oop/goops/util.scm
@@ -17,24 +17,12 @@
(define-module (oop goops util)
- :export (find-duplicate
- map* for-each* length* improper->proper)
- :use-module (srfi srfi-1)
- :re-export (any every)
- :no-backtrace
- )
-
+ #:export (map* for-each* length*))
;;;
;;; {Utilities}
;;;
-(define (find-duplicate l) ; find a duplicate in a list; #f otherwise
- (cond
- ((null? l) #f)
- ((memv (car l) (cdr l)) (car l))
- (else (find-duplicate (cdr l)))))
-
(define (map* fn . l) ; A map which accepts dotted lists (arg lists
(cond ; must be "isomorph"
((null? (car l)) '())
@@ -52,8 +40,3 @@
(do ((n 0 (+ 1 n))
(ls ls (cdr ls)))
((not (pair? ls)) n)))
-
-(define (improper->proper ls)
- (if (pair? ls)
- (cons (car ls) (improper->proper (cdr ls)))
- (list ls)))
- [Guile-commits] 43/88: Remove TEST_CHANGE_CLASS, (continued)
- [Guile-commits] 43/88: Remove TEST_CHANGE_CLASS, Andy Wingo, 2015/01/23
- [Guile-commits] 42/88: Remove pure-generic?, Andy Wingo, 2015/01/23
- [Guile-commits] 46/88: Minor goops.c tidying, Andy Wingo, 2015/01/23
- [Guile-commits] 37/88: goops: use computed class slot offsets; untabify and fix whitepace, Andy Wingo, 2015/01/23
- [Guile-commits] 50/88: Re-use the vtable "size" field for GOOPS nfields, Andy Wingo, 2015/01/23
- [Guile-commits] 52/88: Reimplement inherit-applicable! in Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 54/88: Incorporate %inherit-magic! into %init-layout!, Andy Wingo, 2015/01/23
- [Guile-commits] 49/88: Move <class> initialization to Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 56/88: GOOPS cleanup to use SRFI-1 better, Andy Wingo, 2015/01/23
- [Guile-commits] 57/88: append-map rather than mapappend, Andy Wingo, 2015/01/23
- [Guile-commits] 58/88: GOOPS utils module cleanups,
Andy Wingo <=
- [Guile-commits] 55/88: Cosmetic goops refactors., Andy Wingo, 2015/01/23
- [Guile-commits] 53/88: goops.c no longer knows about <class> slot allocation, Andy Wingo, 2015/01/23
- [Guile-commits] 61/88: scm_make cleanup, Andy Wingo, 2015/01/23
- [Guile-commits] 64/88: More GOOPS comments, Andy Wingo, 2015/01/23
- [Guile-commits] 59/88: Fold (oop goops util) into (oop goops), Andy Wingo, 2015/01/23
- [Guile-commits] 51/88: Reimplement %allocate-instance in Scheme, Andy Wingo, 2015/01/23
- [Guile-commits] 62/88: Narrative reordering in goops.scm, Andy Wingo, 2015/01/23
- [Guile-commits] 66/88: More GOOPS cleanups, Andy Wingo, 2015/01/23
- [Guile-commits] 67/88: Convert emit-linear-dispatch to use match, Andy Wingo, 2015/01/23
- [Guile-commits] 60/88: Add compute-cpl tests, Andy Wingo, 2015/01/23