I have a class that I use to set up my images. A subclass has a method:
setupScript
(Smalltalk at: #UpdateStreamer) new updateFromServer.
"Do other stuff..."
I want to save the statements of the method above in a .st file to pass as an argument to the vm. That's all working, but in order to retrieve the two statements above, I do:
setupScriptContents
| scriptMethod sourceString sourceStringWithBracketsStripped |
scriptMethod := PharoTrunkImage compiledMethodAt: #setupScript.
sourceString := scriptMethod methodNode body asString.
sourceStringWithBracketsStripped := sourceString copyFrom: 3 to: sourceString size - 2.
^ sourceStringWithBracketsStripped.
That works, but I don't like it. What's the best way to do this (or is this it)?
Thanks.
Sean
Cheers,
Sean