Squeak SmalltalkJoker Squeak Smalltalk : System : prevnext Block Creation From String

> How do I programmatically create a block from a string?
>
> The block's context would be the method that is creating the block.
>
 
This is kind of an excerpt from some of my code; you can try it in a
Workspace.
 model := nil. "or set to Browser or Workspace, etc."
 stream := ReadWriteStream
    on: (String new: 100).
 stream nextPutAll: '[ 3 + 4 ]'. "your code here in brackets"
 stream reset.
 (model respondsTo: #doItReceiver)
  ifTrue: [FakeClassPool adopt: model selectedClass.
   "Include model pool vars if any"
   rcvr := model doItReceiver.
   ctxt := model doItContext]
  ifFalse: [rcvr := ctxt := nil].
 result := [rcvr class evaluatorClass new
    evaluate: stream
    in: ctxt
    to: rcvr
    notifying: self
    ifFail: [FakeClassPool adopt: nil.
     ^ #failedDoit]]
    on: OutOfScopeNotification
    do: [:ex | ex resume: true].
 FakeClassPool adopt: nil.

result value