I am by no means the expert on such things, but you caught my attention and a quick look at Array>>printOn: reveals #isLiteral and #isSelfEvaluating. The way an array prints itself changes if all of the arguments (and sometimes the receiver) fit the conditions.
One of your arguments is probably failing to meet a condition in one case. Bill -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of nullPointer Sent: Tuesday, October 27, 2009 4:58 PM To: [email protected] Subject: [Pharo-project] Strange behavior of #printString method I don´t understand the behavior of printString method. in a class I define a method #style , which returns an array... style style notNil ifTrue:[ ^style ] ifFalse:[ ^{ self borderColor . self borderWidth . self color . self gradientColor . (self cornerStyle = #rounded) . true }]. That method returns many times an Array. If #printString of that array is called the result is... '{Color black. 0. (Color r: 0.892 g: 0.887 b: 0.879). nil. false. true}' Well i have another method with same name in another class style ^{ self borderColor . self borderWidth . self color . self gradientColor . (self cornerStyle = #rounded) . true } but in that case when i call #printString of the Array result ... 'an Array(Color transparent 0 (Color r: 0.827 g: 0.827 b: 0.827) nil true true)'. I don´t understand nothing :| Both are instances of Array, and both is declared of same way. Regards -- View this message in context: http://n2.nabble.com/Strange-behavior-of-printString-method-tp3902051p3902051.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com. _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
