unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* goops: make 'allowing' the use of non existing init kw or slot
@ 2011-08-20 19:28 David Pirotte
  2011-08-27 12:16 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: David Pirotte @ 2011-08-20 19:28 UTC (permalink / raw)
  To: bug-guile

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

Hello,

The attached code speaks for itself: shouldn't we get an error on both of these
attempts?

	1]	the slot exists but no :init-keyword was defined;
	2]	the slot does not exists.

Cheers,
David

[-- Attachment #2: goops-make-using-non-existing-kw-or-slot.scm --]
[-- Type: text/x-scheme, Size: 585 bytes --]


(define-module (goops-make-using-non-existing-kw-or-slot)
  :use-module (oop goops)

  :export (<widget-a>
	    dialog
	    no-kw

	    letstry
	    ))


(define-class <widget-a> ()
  (dialog :accessor dialog :init-keyword :dialog :init-value #f)
  (no-kw :accessor no-kw :init-value #f))

(define (letstry)
  (make <widget-a>
    :dialog 'dialog-a
    :no-kw 'no-kw
    :non-existing-slot 'non-existing-slot))


#!

(use-modules (macros push))
(push! "/usr/local/share/guile/alto/2.0/tests"
       %load-path)

(use-modules (goops-make-using-non-existing-kw-or-slot))
(letstry)


!#

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: goops: make 'allowing' the use of non existing init kw or slot
  2011-08-20 19:28 goops: make 'allowing' the use of non existing init kw or slot David Pirotte
@ 2011-08-27 12:16 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2011-08-27 12:16 UTC (permalink / raw)
  To: David Pirotte; +Cc: bug-guile

Hi,

On Sat 20 Aug 2011 21:28, David Pirotte <david@altosw.be> writes:

> The attached code speaks for itself

It does, but it takes me time to parse it.  If possible I prefer a
format of giving short examples inline with a mail message, saying what
you expect should happen, then saying what actually happens.  Just
saying :)


> shouldn't we get an error on both of these attempts?
>
> 	1]	the slot exists but no :init-keyword was defined;
> 	2]	the slot does not exists.

That is not how things have worked in the past.  The algorithm goes,
"for each slot definition, initialize it."  It doesn't go, "for each
keyword-argument pair, see what slot corresponds to it, and error
otherwise".

I think we would need some deeper CLOS / GOOPS insight here to change
this.

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-27 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-20 19:28 goops: make 'allowing' the use of non existing init kw or slot David Pirotte
2011-08-27 12:16 ` Andy Wingo

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).