guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 16/42: Further GOOPS simplifications


From: Andy Wingo
Subject: [Guile-commits] 16/42: Further GOOPS simplifications
Date: Sat, 10 Jan 2015 00:03:08 +0000

wingo pushed a commit to branch wip-goops-refactor
in repository guile.

commit c3f12955c7e2b778ee59a813a4302675acebda16
Author: Andy Wingo <address@hidden>
Date:   Sun Jan 4 15:52:12 2015 -0500

    Further GOOPS simplifications
    
    * libguile/goops.c (scm_no_applicable_method): Define in Scheme and
      capture in C.
    * module/oop/goops.scm (no-applicable-method): Define here.  Import the
      utils module in the normal define-module block.
---
 libguile/goops.c     |    7 +------
 module/oop/goops.scm |    8 +++++---
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/libguile/goops.c b/libguile/goops.c
index 521b6e1..56b638f 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -1895,12 +1895,7 @@ SCM_DEFINE (scm_sys_goops_early_init, 
"%goops-early-init", 0, 0, 0,
   create_struct_classes ();
   create_port_classes ();
 
-  {
-    SCM name = scm_from_latin1_symbol ("no-applicable-method");
-    scm_no_applicable_method =
-      scm_make (scm_list_3 (scm_class_generic, k_name, name));
-    scm_module_define (scm_module_goops, name, scm_no_applicable_method);
-  }
+  scm_no_applicable_method = scm_variable_ref (scm_c_lookup 
("no-applicable-method"));
 
   return SCM_UNSPECIFIED;
 }
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index 56d3243..d250701 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -27,6 +27,7 @@
 (define-module (oop goops)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
+  #:use-module (oop goops util)
   #:export-syntax (define-class class standard-define-class
                     define-generic define-accessor define-method
                     define-extended-generic define-extended-generics
@@ -510,14 +511,15 @@
   (define-standard-class <input-port> (<port>))
   (define-standard-class <output-port> (<port>))
   (define-standard-class <input-output-port> (<input-port> <output-port>))
-  )
+
+  (define no-applicable-method
+    (make <generic> #:name 'no-applicable-method)))
 
 (eval-when (compile load eval)
   (%goops-early-init))
 
 ;; Then load the rest of GOOPS
-(use-modules (oop goops util)
-            (oop goops dispatch)
+(use-modules (oop goops dispatch)
             (oop goops compile))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]