How to export and load shared pools ?
Here the black art I using for this.
I attach ObjectCompatibleENH.1 which I use for exchange some between Squeak,
Pharo and Cuis.
I like export what I need in Foo.obj form.
In this case the pool
In FunSqueak3.10alpha.7 Workspace type B3DEngineConstants and do inspect or
explore.
Navigate to classPool and inspect the dictionary.
In the code panel type self saveOnFileNamed: 'B3DEngineConstantspool'

Drag and drop the object into the FunSqueakCog4.3-11712-alpha, you see some
asking load object (twice, 3.10 only shows one , why ?)
Accept and you have a inspector on this object.
In the code pane type B3DEngineConstants classPool: self
Presto , your have the values you need and no nil when load the .cs for
first time.
Sure exists nicer ways , so I wish learn.

Edgar
'From Squeak4.2alpha of 2 October 2011 [latest update: #11712] on 5 October 
2011 at 5:43:55 am'!

!Object methodsFor: 'objects from disk' stamp: 'edc 10/5/2011 05:43:11.619'!
saveOnFileNamed: aString 
        "Ask the user for a filename and save myself on a
        ReferenceStream file. Writes out the version and class structure.
        The file is fileIn-able. UniClasses will be filed out.
        This save objects as .obj"
        | aFileName fileStream |
        aString isEmpty
                ifTrue: [^ self error: 'name is missing'].
        aFileName := aString , '.obj'.
        fileStream := ReferenceStream fileNamed: aFileName .
        fileStream nextPut: self.
        fileStream close.
        ! !


!Object class methodsFor: '*services-extras' stamp: 'edc 2/14/2008 08:24'!
fileReaderServicesForFile: fullName suffix: suffix
        | services |
        services _ OrderedCollection new.
        
        (fullName asLowercase endsWith: '.obj')
                ifTrue: [ services add: self serviceLoadObject ].
        ^services! !

!Object class methodsFor: '*services-extras' stamp: 'edc 2/14/2008 08:26'!
serviceLoadObject
"Answer a service for opening a saved Object"

        ^ (SimpleServiceEntry 
                provider: self 
                label: 'saved Object'
                selector: #readAndInspect:
                description: 'open a Object'
                buttonLabel: 'object')
                argumentGetter: [:fileList | fileList readOnlyStream]! !

!Object class methodsFor: 'objects from disk' stamp: 'edc 7/1/2011 10:17'!
readAndInspect: inputStream
| o rr |
        rr _ ReferenceStream on: inputStream.
        o _ rr next.
        rr close.
        o inspect! !


!Object class reorganize!
('*SlangBrowser-VMMaker-Translation to C' asCString: asInlinedCString:)
('*VMMaker-plugin generation' ccg:emitLoadFor:from:on: 
ccg:generateCoerceToOopFrom:on: ccg:generateCoerceToValueFrom:on: 
ccg:prolog:expr:index: ccgCanConvertFrom: ccgDeclareCForVar:)
('*ma base additions' registerSelfAsFileReader)
('*ma object serialization' maInstancesRequireOwnBuffer 
maLoadVariableObjectFrom: maMaterializeFrom:using:)
('*magritte-model-accessing' description)
('*metacello-mc' lastMetacelloVersionLoad metacelloVersion:loads:)
('*services-extras' fileReaderServicesForFile:suffix: readCompressedObject: 
registeredServices serviceCompressedObject serviceLoadObject)
('class initialization' flushDependents flushEvents initialize 
initializeDependentsFields reInitializeDependentsFields)
('documentation' howToModifyPrimitives whatIsAPrimitive)
('file list services' fileReaderServicesForDirectory: services)
('instance creation' categoryForUniclasses chooseUniqueClassName 
initialInstance initializedInstance instanceOfUniqueClass 
instanceOfUniqueClassWithInstVarString:andClassInstVarString: isUniClass 
lookForClass: lookForClassIn3dot10: lookForClassIn3dot11: lookForClassIn3dot9: 
newFrom: newUniqueClassInstVars:classInstVars: newUserInstance 
readCarefullyFrom: readFrom:)
('objects from disk' createFrom:size:version: readAndInspect:)
('window color' windowColorSpecification)
('private' releaseExternalSettings)
!

Reply via email to