Skip to content

Commit cfb7fce

Browse files
committed
another step
1 parent a8df937 commit cfb7fce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Chapters/PharoObjectModel/PharoObjectModel.pillar

+2-2
Original file line numberDiff line numberDiff line change
@@ -654,15 +654,15 @@ Point class allInstVarNames
654654
>>> "#(#superclass #methodDict #format #layout #organization #subclasses #name #classPool #sharedPools #environment #category)"
655655
]]]
656656

657-
[[[example=true|label=scr:instance|caption=New state for classes.
657+
[[[example=true
658658
WebServer class allInstVarNames
659659
>>> "#(#superclass #methodDict #format #layout #organization #subclasses #name #classPool #sharedPools #environment #category #uniqueInstance)"
660660
]]]
661661

662662
We can now define a class method named ==uniqueInstance==, as shown below. This method first checks whether ==uniqueInstance== has been initialized. If it has not, the method creates an instance and assigns it to the class instance variable ==uniqueInstance==. Finally the value of ==uniqueInstance== is returned.
663663
Since ==uniqueInstance== is a class instance variable, this method can directly access it.
664664

665-
[[[language=smalltalk|label=scr:uniqueInstance|caption=Class-side accessor method ==uniqueInstance==.
665+
[[[language=smalltalk
666666
WebServer class >> uniqueInstance
667667
uniqueInstance ifNil: [ uniqueInstance := self new ].
668668
^ uniqueInstance

0 commit comments

Comments
 (0)