[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: goops - guile-clutter unexpected bug while using #:virtual slot allo

From: David Pirotte
Subject: Re: goops - guile-clutter unexpected bug while using #:virtual slot allocation for a <clutter-actor> subclass
Date: Tue, 27 Jan 2015 17:35:52 -0200

To be complete, raise the confusion, and allow who would want to follow and
test, the setter bug test case I pasted on irc was this one (*):

Using guile versions previous to the goops refactoring work Andy did recently, 
have this answer:

        scheme@(guile-user)> ,use (oop goops)
        scheme@(guile-user)> ,use (b)
        scheme@(guile-user)> (set! (!width (make <b>)) 10)
        $2 = 10

The expected and correct answer after the refactoring... is

        scheme@(guile-user)> (set! (!width (make <b>)) 10)

        ;;; ("this is <a> !width setter method, hello!")



;; module a.scm starts here
(define-module (a)
  #:use-module (oop goops)
  #:export (<a>

(define-class <a> ()
  (width #:accessor !width #:init-keyword #:width #:init-value 0))

(define-method ((setter !width) (self <a>) width)
  ;; here comes complex code, computing earth orbit and calling lower
  ;; level clutter internals, such as the <clutter-actor> layout...
  (pk "this is <a> !width setter method, hello!")
  (slot-set! self 'width width))
;; module ends here

;; module b.scm starts here
(define-module (b)
  #:use-module (oop goops)
  #:use-module (a)
  #:export (<b>)

  #:re-export (!width))

(define-class <b> (<a>))

#;(define-method ((setter !width) (self <b>) width)
;; module ends here

Attachment: pgpzceta04k65.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]