unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Add support for record types in GOOPS methods?
Date: Tue, 21 Oct 2014 12:00:51 -0400	[thread overview]
Message-ID: <CAJ=RwfaLP8JJr5rMxoN9VeMWFAKmvLqtYQWou92L6y-0daWRVw@mail.gmail.com> (raw)
In-Reply-To: <CAMFYt2ZTEtkddHnBNFKWoTYZzsTkkCH1ePWE4vX2yerDAamr_g@mail.gmail.com>

On Tue, Oct 21, 2014 at 11:37 AM, Panicz Maciej Godek
<godek.maciek@gmail.com> wrote:
>
> Hi!
> As I managed to find out, the (define-record-type t ...) also introduces a
> GOOPS class named <t>. Following your example, you'd need to define your
> method in the following way:
>
> (define-method (foobar (foo <<foo>>))
>     (foo-bar foo))
>
> I don't think any further changes are needed (perhaps a section in the
> documentation would be nice)

I had no idea that magic was happening.  Thanks!  That solves my
immediate need, though I think defining something that I didn't
explicitly ask for is strange.

I thought that I could make this technique fail by defining the record
type before importing (oop goops), but it still worked.  Why?

- Dave



      reply	other threads:[~2014-10-21 16:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 14:57 Add support for record types in GOOPS methods? Dave Thompson
2014-10-21 15:37 ` Panicz Maciej Godek
2014-10-21 16:00   ` Thompson, David [this message]

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='CAJ=RwfaLP8JJr5rMxoN9VeMWFAKmvLqtYQWou92L6y-0daWRVw@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=godek.maciek@gmail.com \
    --cc=guile-devel@gnu.org \
    /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).