unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andreas Rottmann <a.rottmann@gmx.at>
Cc: Guile Users <guile-user@gnu.org>, guile-devel@gnu.org
Subject: Re: GOOPS-based SRFI-35 implementation
Date: Mon, 08 Mar 2004 21:07:45 +0100	[thread overview]
Message-ID: <87r7w3yuem.fsf@ivanova.rotty.yi.org> (raw)
In-Reply-To: <85llmerxiq.fsf@ossau.uklinux.net> (Neil Jerram's message of "06 Mar 2004 12:05:33 +0000")

Neil Jerram <neil@ossau.uklinux.net> writes:

> Hmm.  My inclination is that it would be nicer if a compound condition
> straightforwardly satisfied is-a? for all its component condition type
> classes (without specialization of is-a?).  
>
> The big benefit of this is that methods defined for the component
> types will work on (instances of) the compound type as well, which
> makes sense because we know that the compound type has all the slots
> of the component type.
>
> The possible problem is that `make-compound-condition' would have to
> construct an appropriate subclass on the fly, and that this should
> interact nicely with compound condition classes created explicitly by
> the programmer, e.g.:
>

> (define-class &my-condition (&i/o-condition &runtime-condition)
>   ...)
>
> In other words, given this define-class, the result of
>
> (make-condition &my-condition ...)
>
> should be indistinguishable from that of
>
> (make-compound-condition &i/o-condition (...)
>                          &runtime-condition (...))
>  
I think you mean condition instead of make-compound-condition here.

> but I think this is achievable.
>
It may be, but this probably involves "caching" defined (via
define-class or the condition macro) condition types by their
supertypes. This, in turn, disallows defining different define-class
statements specifiying the same supers (if the supers are conditions).

Another, much more serious problem is the following:

(define-condition-type &c &condition
  c?
  (x c-x))

(define-condition-type &c1 &c
  c1?
  (a c1-a))

(define-condition-type &c2 &c
  c2?
  (b c2-b))

(define v2 (condition (&c2 (x "V2") (b "b2"))))
(define v3 (condition (&c1 (x "V3/1") (a "a3"))
                      (&c2 (b "b3"))))
(define v5 (make-compound-condition v2 v3)) ;; This is hairy

Here, we given your proposed model, we'd get this hierarchy:

(define-class &c ())
(define-class &c1 (&c))
(define-class &c2 (&c))
(define-class &c3 (&c1 &c2)) ;; Class constructed for v3
(define-class &c5 (&c2 &c3)) ;; Class constructed for v5

This will cause GOOPS to barf: "merge-lists: Inconsistent precedence graph"

I didn't see an obvious solution to this problem.

Andy
-- 
Andreas Rottmann         | Rotty@ICQ      | 118634484@ICQ | a.rottmann@gmx.at
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Make free software, not war!


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  parent reply	other threads:[~2004-03-08 20:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-28 15:53 GOOPS-based SRFI-35 implementation Andreas Rottmann
2004-03-03 16:02 ` Neil Jerram
2004-03-04  0:20   ` Andreas Rottmann
2004-03-06 12:05     ` Neil Jerram
2004-03-06 14:52       ` Andreas Rottmann
2004-03-08 20:07       ` Andreas Rottmann [this message]
2004-03-10  9:17         ` Neil Jerram
2004-03-11 15:38         ` Mikael Djurfeldt

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=87r7w3yuem.fsf@ivanova.rotty.yi.org \
    --to=a.rottmann@gmx.at \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@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).