chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] coops / override initialize-instance


From: John J Foerch
Subject: [Chicken-users] coops / override initialize-instance
Date: Tue, 08 Mar 2011 16:30:32 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hello,

What is the recommended way to perform complex initialization of object
instances in coops?  Say I need to initialize a certain slot based on
the values of other slots in the object.  Is the initialize-instance
generic designed in a way that it is safe to do something like this:

  (define-method (initialize-instance (o <myobject))
    ;; initialization code here
    )

or is it recommended to write a wrapper function like this:

  (define (make-myobject a b c)
    (let ((o (make <myobject> 'a a 'b b 'c c)))
      ;; initialization code here
      o))

Or is there a better approaches?

-- 
John Foerch




reply via email to

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