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

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

[PATCH] bugfix for generics


From: Andy Wingo
Subject: [PATCH] bugfix for generics
Date: Fri, 02 Feb 2007 15:26:03 +0100

Hi,

Another bugfix. This makes three revisions that need merging:

104, configuring whether to leave guile or not when calling a function
105, a merge from you
106, this one:

2007-02-02  Andy Wingo  <address@hidden>

        * guile/g-wrap/guile-runtime.c
        ("%gw:procedure-to-method-public!"): Fix a bug that prevented
        method addition to a generic that was already forced.

I'm attaching this bundle for review, but I suggest when merging that
you just pull from http://wingolog.org/bzr/g-wrap/wingo/. Guile-gnome
from bzr requires revision 104, and 106 to fix some bugs.

Cheers,

Andy.
-- 
http://wingolog.org/
# Bazaar revision bundle v0.8
#
# message:
#   2007-02-02  Andy Wingo  <address@hidden>
#   
#       * guile/g-wrap/guile-runtime.c
#       ("%gw:procedure-to-method-public!"): Fix a bug that prevented
#       method addition to a generic that was already forced.
#   
# committer: Andy Wingo <address@hidden>
# date: Fri 2007-02-02 15:18:16.812000036 +0100

=== modified file ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,9 @@
+2007-02-02  Andy Wingo  <address@hidden>
+
+       * guile/g-wrap/guile-runtime.c
+       ("%gw:procedure-to-method-public!"): Fix a bug that prevented
+       method addition to a generic that was already forced.
+
 2007-01-04  Andy Wingo  <address@hidden>
 
        Add a flag to GWFunctionInfo to control whether or not we leave

=== modified file guile/g-wrap/guile-runtime.c
--- guile/g-wrap/guile-runtime.c
+++ guile/g-wrap/guile-runtime.c
@@ -544,6 +544,19 @@
   pair = scm_hashq_ref (latent_variables_hash, generic_name, SCM_BOOL_F);
 
   if (scm_is_false (pair)) {
+    SCM var = scm_hashq_ref (SCM_MODULE_OBARRAY (generics),
+                             generic_name, SCM_BOOL_F);
+    if (!scm_is_false (var)) {
+      /* some other module already forced it, hang the method */
+      gw_guile_add_subr_method (SCM_VARIABLE_REF (var),
+                                proc,
+                                specializers,
+                                scm_current_module (),
+                                scm_to_int (n_req_args), 
+                                scm_is_true (use_optional_args));
+      return;
+    }
+
     pair = scm_cons (sym_generic, SCM_EOL);
     scm_hashq_set_x (latent_variables_hash, generic_name, pair);
   } else if (!scm_is_eq (scm_car (pair), sym_generic)) {

# revision id: address@hidden
# sha1: 4de40412e7a2f93aee1f138baac519574da73f0a
# inventory sha1: 0bc882f3a9fbe76c83fa97f3c9462b7b42b51462
# parent ids:
#   address@hidden
# base id: address@hidden
# properties:
#   branch-nick: wingo


reply via email to

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