Re: More default methode issues

Frank <[email protected]> Sun, 06 Jun 2010 14:05:05 -0600
Newsgroups gmane.emacs.eieio
Message-ID <[email protected]>
Frank schrieb:

> Hi,
>
> This looks like a glitch to me.
>
>
> (require 'eieio)
>
> (defclass foo ()
>  ())
>
> (defmethod func (this)
>  (message "func default %s" this))
>
> (defmethod func :before ((this foo))
>  (message "func foo :before %s" this))
>
> ;; (defmethod func :primary ((this foo))
> ;;   (message "func foo :primary %s" this)
> ;;   123)
>
> (defmethod func :after ((this foo))
>  (message "func foo :after %s" this))
>
> ;; This one is probably OK.
> (func (make-instance 'foo))
>
> ;; Must be wrong as a methode which is bound for class foo is called!
> ;; I assume the default methode should be called.
> (func 666)
>
I think I have to correct myself a bit;
(func 666) is probably not supposed to call the default method as 666 is 
not an (eieio) object here;
(It should throw an error instead!!??)

Considering we add this
(defclass any ()
  ())

Then this calls the default method as expected
(func (make-instance 'any))



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo