g-wrap-dev
[Top][All Lists]
Advanced

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

Re: [PATCH] Allow null-ok in wct types


From: Ludovic Courtès
Subject: Re: [PATCH] Allow null-ok in wct types
Date: Mon, 30 Oct 2006 10:34:54 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hi,

Andy Wingo <address@hidden> writes:

> The attached patch allows 'null-ok as an option in wct types. This fixes
> for example (g-main-loop-new #f), along with a patch I'm pushing now to
> guile-gnome.

Cool, thanks.

I'm still trying to merge things from Andreas' branch but sometimes I
don't understand the point of some changes.

For instance, what's this:

#v+
--- orig/guile/g-wrap/guile.scm
+++ mod/guile/g-wrap/guile.scm
@@ -52,6 +52,10 @@
            <gw-guile-rti-type>
            scm-var))
 
+(module-use! (module-public-interface (current-module))
+             (resolve-interface '(g-wrap c-codegen)))
+(module-use! (module-public-interface (current-module))
+             (resolve-interface '(g-wrap scm-codegen)))
 
 
 ;;;
@@ -886,31 +890,38 @@
                      (hashq-create-handle! gf-hash gf-name '())))
                 (set-cdr! handle (cons func (cdr handle)))))))
        #f wrapset)
-         (hash-fold
-          (lambda (gf funcs rest)
-            (for-each
-             (lambda (func)
-               (write
-                `(%gw:procedure->method-public
-                  ,(name func)
-                  ;; Specializers
-                  ',(map (lambda (arg)
-                           (let ((typespec (typespec arg)))
-                             (and (not (memq 'unspecialized
-                                             (options typespec)))
-                                  (class-name (type typespec)))))
-                         (filter visible? (arguments func)))
-                  ',gf
-                  ;; Required argument count
-                  ,(- (input-argument-count func)
-                      (optional-argument-count func))
-                  ;; Optional arguments?
-                  ,(not (zero? (optional-argument-count func))))
-                port)
-               (newline port))
-             funcs)
-            (newline port))
-          #f gf-hash))))
+      (hash-fold
+       (lambda (gf funcs rest)
+         (for-each
+          (lambda (func)
+            (write
+             `(%gw:procedure->method-public
+               ,(name func)
+               ;; Specializers
+               ',(map (lambda (arg)
+                        (let ((typespec (typespec arg)))
+                          (and (not (memq 'unspecialized
+                                          (options typespec)))
+                               (class-name (type typespec)))))
+                      (filter visible? (arguments func)))
+               ',gf
+               ;; Required argument count
+               ,(- (input-argument-count func)
+                   (optional-argument-count func))
+               ;; Optional arguments?
+               ,(not (zero? (optional-argument-count func))))
+             port)
+            (newline port))
+          funcs)
+         (newline port))
+       #f gf-hash)
+      (write
+       '(if (defined? '%generics)
+            (begin
+              (module-use! (module-public-interface (current-module))
+                           %generics)))
+       port)
+      (newline port))))
 
 (define (make-header-def-sym filename)
   (string-append "__"

#v-

No one should ever be using `module-use!' unless there's a really strong
reason to do it.

Also it might be worth augmenting the test suite given the amount of
code that has changed (wrt. to latent binding in particular).

> Also available in the bzr archive at

That clearly makes it harder for me to interact with you (I know, you
don't like Arch, but...).

BTW, we still haven't heard from Rotty about the relation between G-Wrap
and Guile-Gnome and the future (or lack thereof) of G-Wrap...

Thanks,
Ludovic.




reply via email to

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