[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 58/87: Fold (oop goops util) into (oop goops)
From: |
Andy Wingo |
Subject: |
[Guile-commits] 58/87: Fold (oop goops util) into (oop goops) |
Date: |
Thu, 22 Jan 2015 17:30:06 +0000 |
wingo pushed a commit to branch wip-goops-refactor
in repository guile.
commit 71c47f8bcedcbd3131d7fda19c3ed17b927973ac
Author: Andy Wingo <address@hidden>
Date: Mon Jan 12 21:43:48 2015 +0100
Fold (oop goops util) into (oop goops)
* module/oop/goops/util.scm: Removed. Instead we fold these definitions
into goops.scm.
* module/oop/goops/save.scm: Remove useless import of util.scm.
* module/oop/goops.scm: Fold in util.scm.
* module/Makefile.am: Adapt.
---
module/Makefile.am | 1 -
module/oop/goops.scm | 26 +++++++++++++++++++++++++-
module/oop/goops/save.scm | 3 +--
module/oop/goops/util.scm | 42 ------------------------------------------
4 files changed, 26 insertions(+), 46 deletions(-)
diff --git a/module/Makefile.am b/module/Makefile.am
index dc22700..51397ba 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -361,7 +361,6 @@ OOP_SOURCES = \
oop/goops/internal.scm \
oop/goops/save.scm \
oop/goops/stklos.scm \
- oop/goops/util.scm \
oop/goops/accessors.scm \
oop/goops/simple.scm
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index ddadab6..8f8d85b 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -27,7 +27,6 @@
(define-module (oop goops)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
- #:use-module (oop goops util)
#:use-module (system base target)
#:export-syntax (define-class class standard-define-class
define-generic define-accessor define-method
@@ -1770,6 +1769,31 @@ followed by its associated value. If @var{l} does not
hold a value for
(goops-error "~S is not a valid generic function" obj))
;;;
+;;; {Utilities}
+;;;
+;;; These are useful when dealing with specializers lists, which might
+;;; have a rest argument.
+;;;
+
+(define (map* fn . l) ; A map which accepts dotted lists (arg lists
+ (cond ; must be "isomorph"
+ ((null? (car l)) '())
+ ((pair? (car l)) (cons (apply fn (map car l))
+ (apply map* fn (map cdr l))))
+ (else (apply fn l))))
+
+(define (for-each* fn . l) ; A for-each which accepts dotted lists (arg
lists
+ (cond ; must be "isomorph"
+ ((null? (car l)) '())
+ ((pair? (car l)) (apply fn (map car l)) (apply for-each* fn (map cdr l)))
+ (else (apply fn l))))
+
+(define (length* ls)
+ (do ((n 0 (+ 1 n))
+ (ls ls (cdr ls)))
+ ((not (pair? ls)) n)))
+
+;;;
;;; {Access to meta objects}
;;;
diff --git a/module/oop/goops/save.scm b/module/oop/goops/save.scm
index dda2aea..a3492a9 100644
--- a/module/oop/goops/save.scm
+++ b/module/oop/goops/save.scm
@@ -1,6 +1,6 @@
;;; installed-scm-file
-;;;; Copyright (C) 2000,2001,2002, 2006, 2009, 2010, 2013 Free Software
Foundation, Inc.
+;;;; Copyright (C) 2000,2001,2002, 2006, 2009, 2010, 2013, 2015 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
@@ -20,7 +20,6 @@
(define-module (oop goops save)
:use-module (oop goops internal)
- :use-module (oop goops util)
:re-export (make-unbound)
:export (save-objects load-objects restore
enumerate! enumerate-component!
diff --git a/module/oop/goops/util.scm b/module/oop/goops/util.scm
deleted file mode 100644
index 8b48f98..0000000
--- a/module/oop/goops/util.scm
+++ /dev/null
@@ -1,42 +0,0 @@
-;;;; Copyright (C) 1999, 2000, 2001, 2003, 2006, 2008, 2012, 2015 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 as published by the Free Software Foundation; either
-;;;; version 3 of the License, or (at your option) any later version.
-;;;;
-;;;; This library is distributed in the hope that it will be useful,
-;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;;;; Lesser General Public License for more details.
-;;;;
-;;;; You should have received a copy of the GNU Lesser General Public
-;;;; License along with this library; if not, write to the Free Software
-;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
-;;;;
-
-
-(define-module (oop goops util)
- #:export (map* for-each* length*))
-
-;;;
-;;; {Utilities}
-;;;
-
-(define (map* fn . l) ; A map which accepts dotted lists (arg lists
- (cond ; must be "isomorph"
- ((null? (car l)) '())
- ((pair? (car l)) (cons (apply fn (map car l))
- (apply map* fn (map cdr l))))
- (else (apply fn l))))
-
-(define (for-each* fn . l) ; A for-each which accepts dotted lists (arg
lists
- (cond ; must be "isomorph"
- ((null? (car l)) '())
- ((pair? (car l)) (apply fn (map car l)) (apply for-each* fn (map cdr l)))
- (else (apply fn l))))
-
-(define (length* ls)
- (do ((n 0 (+ 1 n))
- (ls ls (cdr ls)))
- ((not (pair? ls)) n)))
- [Guile-commits] 56/87: append-map rather than mapappend, (continued)
- [Guile-commits] 56/87: append-map rather than mapappend, Andy Wingo, 2015/01/22
- [Guile-commits] 55/87: GOOPS cleanup to use SRFI-1 better, Andy Wingo, 2015/01/22
- [Guile-commits] 48/87: Re-use the vtable "size" field for GOOPS nfields, Andy Wingo, 2015/01/22
- [Guile-commits] 54/87: Cosmetic goops refactors., Andy Wingo, 2015/01/22
- [Guile-commits] 47/87: Move <class> initialization to Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 50/87: Reimplement inherit-applicable! in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 45/87: Rewrite %initialize-object in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 49/87: Reimplement %allocate-instance in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 51/87: goops.c no longer knows about <class> slot allocation, Andy Wingo, 2015/01/22
- [Guile-commits] 57/87: GOOPS utils module cleanups, Andy Wingo, 2015/01/22
- [Guile-commits] 58/87: Fold (oop goops util) into (oop goops),
Andy Wingo <=
- [Guile-commits] 61/87: scm_make cleanup, Andy Wingo, 2015/01/22
- [Guile-commits] 60/87: Add compute-cpl tests, Andy Wingo, 2015/01/22
- [Guile-commits] 35/87: goops: use computed class slot offsets; untabify and fix whitepace, Andy Wingo, 2015/01/22
- [Guile-commits] 59/87: Scheme GOOPS cleanups, Andy Wingo, 2015/01/22
- [Guile-commits] 63/87: Commenting in goops.scm, Andy Wingo, 2015/01/22
- [Guile-commits] 64/87: More GOOPS comments, Andy Wingo, 2015/01/22
- [Guile-commits] 67/87: Convert emit-linear-dispatch to use match, Andy Wingo, 2015/01/22
- [Guile-commits] 66/87: More GOOPS cleanups, Andy Wingo, 2015/01/22
- [Guile-commits] 62/87: Narrative reordering in goops.scm, Andy Wingo, 2015/01/22
- [Guile-commits] 69/87: GOOPS class slot indices defined as inline values, Andy Wingo, 2015/01/22