unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: goops method defined only in derived classes fails to become generic?
Date: Fri, 11 Feb 2011 19:49:29 +0100	[thread overview]
Message-ID: <1297450169.2325.260.camel@vuurvlieg> (raw)
In-Reply-To: <m3y65md1hv.fsf@unquote.localdomain>

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

Andy Wingo schreef op vr 11-02-2011 om 16:39 [+0100]:
> On Wed 02 Feb 2011 14:34, Jan Nieuwenhuizen <janneke@gnu.org> writes:

> Do you have a test case?

It was in the attached tarball, I'm attaching the individual files.

Jan

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

[-- Attachment #2: use.scm --]
[-- Type: text/x-scheme, Size: 195 bytes --]

#! /bin/sh
# -*- scheme -*-
exec guile --debug -L $(dirname $0) -s $0 "$@"
!#

(use-modules
 (oop goops)
 (base)
 (impl-a)
 (impl-b)
 )

(define obj (make <impl-a>))

(func obj)

(func-impl obj)

[-- Attachment #3: impl-b.scm --]
[-- Type: text/x-scheme, Size: 322 bytes --]

(define-module (impl-b)
  #:use-module (oop goops)
  #:use-module (base)
  #:export (<impl-b>
	    func-impl)
  #:re-export (func))

(define-class <impl-b> (<base>))

(define-method (func (self <impl-b>))
  (format #t "<impl-b>: func\n"))

(define-method (func-impl (self <impl-a>))
  (format #t "<impl-a>: func-impl\n"))

[-- Attachment #4: impl-a.scm --]
[-- Type: text/x-scheme, Size: 322 bytes --]

(define-module (impl-a)
  #:use-module (oop goops)
  #:use-module (base)
  #:export (<impl-a>
	    func-impl)
  #:re-export (func))

(define-class <impl-a> (<base>))

(define-method (func (self <impl-a>))
  (format #t "<impl-a>: func\n"))

(define-method (func-impl (self <impl-a>))
  (format #t "<impl-a>: func-impl\n"))

[-- Attachment #5: base.scm --]
[-- Type: text/x-scheme, Size: 175 bytes --]

(define-module (base)
  #:use-module (oop goops)
  #:export (<base>
	    func))

(define-class <base> ())

(define-method (func (self <base>))
  (format #t "<base>: func\n"))

  reply	other threads:[~2011-02-11 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 13:34 goops method defined only in derived classes fails to become generic? Jan Nieuwenhuizen
2011-02-11 15:39 ` Andy Wingo
2011-02-11 18:49   ` Jan Nieuwenhuizen [this message]
2011-05-21 16:41 ` Andy Wingo
  -- strict thread matches above, loose matches on Subject: below --
2011-02-02 14:05 Jan Nieuwenhuizen

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=1297450169.2325.260.camel@vuurvlieg \
    --to=janneke@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).