Hi,

I would encourage you to simply extend the inspector. Something like this:

MyEvaluator>>gtInspectorEvaluateIn: composite
        <gtInspectorPresentationOrder: 0>
        composite text
                title: ‘Evaluator’;
                populate: #selection iconName:#glamorousGo entitled: ‘Evaluate' 
with: [ :textPresentation | 
                        self from: (MyReader from: textPresentation text)]

And then inspect MyEvaluator new.

If you cannot have an evaluator instance without the reader, add the extension 
to the class side of MyEvaluator and inspect the MyEvaluator class.

Cheers,
Doru



> On Dec 9, 2017, at 12:04 AM, cheshirecatalyst <dekathe...@gmail.com> wrote:
> 
> I've recently picked up pharo, and am writing a small interpreter for a 
> trivial language the details of which are unimportant. However I am looking 
> for the simplest way to avoid having to use playground and Transcript to do 
> something like
> 
> | reader eval |
> reader := MyReader from: 'some stuff in my DSL'.
> eval := MyEvaluator from: reader.
> Transcript show: eval evaluate.
> 
> I'm tired of having to change 'some stuff in my DSL' to a new expression and 
> run it in playground.
> 
> I don't really care which is easier, a Morphic with an input box at the 
> bottom to put my expressions in with output up top, or a something like 
> CommandShellTranscript (which i have looked at but is too complex for me to 
> figure out how to get the desired result from).
> 
> Basically I want to be able to use my DSL outside of playground, but still in 
> image. 

--
www.tudorgirba.com
www.feenk.com

"Yesterday is a fact.
 Tomorrow is a possibility.
 Today is a challenge."





Reply via email to