Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

probelm with initialization

New Message Reply Date view Thread view Subject view Author view

Subject: probelm with initialization
From: Paolo Campo (paoloppa@yahoo.com)
Date: Thu Jun 02 2005 - 09:28:56 CEST

hello everyone,

i have a problem with the new version of cormas. it is with this particular method:
=============================================================================================
initObjects
        
        "Remove all the PassiveObjects and Located Objects"
        | coll |
        self class passiveClasses do:
                        [:aClass |
                        (aClass inheritsFrom: Msg) ifTrue: [^nil].
                        aClass CurrentId: 0.
                        (aClass inheritsFrom: ObjectLocation)
                                ifTrue:
                                        [coll := self perform: ('the' , aClass name asString , 's') asSymbol.
                                        coll ifNotNil: [coll do: [:LO | LO leave]]].
                        self perform: ('the' , aClass name asString , 's:') asSymbol
                                with: IndexedSet new]
=============================================================================================

the problem is the line "(aClass inheritsFrom: Msg) ifTrue: [^nil]." stops the operation even if
there are still other members of the collection of passiveClasses that have yet to be evaluated.
For example, my passiveClasses have 5 members. The first one is a message and the 4th member is a
located object. On the first loop, the line "(aClass inheritsFrom: Msg)" is true and therefore
returns a value of "nil" without going thru the 2nd to 5th members of the collection. What
happens is that when i initialize my model, my located object has a value of nil, which should
have been an indexed set.

i tried correcting it but i am not sure if what i did was correct. it was just enough so that my
located object would be evaluated by the rest of the codes.

could someone help me so as to correct this problem?

thank you

Paolo

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

New Message Reply Date view Thread view Subject view Author view
 

Back to home