[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24955: defining a record type does not also define a GOOPS class in
From: |
Andy Wingo |
Subject: |
bug#24955: defining a record type does not also define a GOOPS class in Guile 2.1 |
Date: |
Mon, 09 Jan 2017 22:43:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
On Wed 16 Nov 2016 16:26, "Thompson, David" <address@hidden> writes:
> Hello,
>
> It used to be, in Guile 2.0, that defining a record type <foo> would
> also, in an unhygienic manner, define the GOOPS class <<foo>> for use
> with generic methods. However, in Guile 2.1, this does not happen.
> Example:
>
> (use-modules (srfi srfi-9)
> (oop goops))
>
> (define-record-type <foo>
> (make-foo bar)
> foo?
> (bar foo-bar))
>
> <<foo>> ;; Unbound variable: <<foo>>
>
> Was this an intentional breaking change? I do find it weird that a
> variable binding is magically defined, but I still would like some way
> to access the class wrapper for a record type without doing something
> hacky like:
>
> (define <<foo>> (class-of (make-foo 'bar)))
See NEWS:
** Defining a SMOB or port type no longer mucks exports of `(oop goops)'
It used to be that defining a SMOB or port type added an export to
GOOPS, for the wrapper class of the smob type. This violated
modularity, though, so we have removed this behavior.
I think in the future <foo> should be classy already as a kind of
primitive class -- (class-of (make-foo ...)) should eq? <foo>. That
doesn't happen now yet though. Closing as not a bug unless you have
really strong opinions here.
A
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#24955: defining a record type does not also define a GOOPS class in Guile 2.1,
Andy Wingo <=