unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: David Pirotte <david@altosw.be>
Cc: 24286@debbugs.gnu.org
Subject: bug#24286: Guile-2.2: srfi-1 + #:duplicates (merge-generics...) + for-each raises an exception
Date: Fri, 02 Sep 2016 09:30:10 +0200	[thread overview]
Message-ID: <8760qekbct.fsf@pobox.com> (raw)
In-Reply-To: <20160821220333.24968f49@capac> (David Pirotte's message of "Sun,  21 Aug 2016 22:03:33 -0300")

On Mon 22 Aug 2016 03:03, David Pirotte <david@altosw.be> writes:

> Hello Guilers,
> Hi Andy,
>
> Here below a mini module [1], which raises an exception [2] using 2.1.3.104-8f2f8 (it
> compiles fine using 2.0.12).  It looks a bit of a 'silly' module but the real one
> here do need this combination, I just minimized it for tracking purposes...
>
> For info, if I either comment the use of srfi-1, or merge-generics, _or_ the for-each
> expression, it compiles fine. I also tried foo to just do a (filter-map string?
> words) and no for-each, to circumvent the problem as far as I could, and it
> compiles fie as well: it appears there is a side effect of the for-each version from
> srfi-1 over the core version, when using goops and declaring #:duplicates
> (merge-generics ...).
>
> Cheers,
> David
>
> [1]
>
> (define-module (foo)
>   #:use-module (srfi srfi-1)
>   #:use-module (oop goops)
>   
>   #:duplicates (merge-generics
> 		replace
> 		warn-override-core
> 		warn
> 		last)

So here you are importing two definitions of for-each: one from (guile)
and one from (srfi srfi-1).  They are both normal procedures.  What
should happen?  I guess merge-generics should fail to do anything.  I
suppose that is the intention of this method in (oop goops):

  (define-method (merge-generics (module <module>)
                                 (name <symbol>)
                                 (int1 <module>)
                                 (val1 <top>)
                                 (int2 <module>)
                                 (val2 <top>)
                                 (var <top>)
                                 (val <top>))
    #f)

And yet you get:

  ERROR: No applicable method for #<<generic> merge-generics (3)> in call (merge-generics #<directory (foo) 204c480> for-each #<interface (guile) 20f1ea0> #<procedure for-each (f l) | (f l1 l2) | (f l1 . rest)> #<interface (srfi srfi-1) 21322d0> #<procedure for-each (f l) | (f l1 l2) | (f l1 . rest)> #f #f)

This sounds like a bug to me, surely the method should match.

On the other hand this looks bogus to me:

  scheme@(foo)> (class-of (resolve-interface '(guile)))
  $4 = #<<class> <module> 244bbd0>
  scheme@(foo)> (class-of (resolve-interface '(guile)))
  $5 = #<<class> <module> 244b900>

Why are we getting two distinct values for the class?  Further
investigation necessary.

Andy





  reply	other threads:[~2016-09-02  7:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22  1:03 bug#24286: Guile-2.2: srfi-1 + #:duplicates (merge-generics...) + for-each raises an exception David Pirotte
2016-09-02  7:30 ` Andy Wingo [this message]
2016-09-02  7:44 ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760qekbct.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=24286@debbugs.gnu.org \
    --cc=david@altosw.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).