[squeak-dev] Re: Injecting objects into Workspace bindings

Jakob Reschke jakob.reschke at student.hpi.de
Thu Mar 17 23:36:41 UTC 2016


2016-03-17 17:55 GMT+01:00 Chris Muller <ma.chris.m at gmail.com>:
> All Jakob had to do was "do it" on:
>
>   myXml := '<SomeElement>.... all kinds of XML ... </SomeElement>'
>
> He now has access to myXml.  Then replace all the text in the
> workspace with that from the other workspace.  Done.

If the markup had not been "vast" (12 MB) and possibly full of single
quotes, that would have been my way to go, too. I could have attempted
a global search and replace for these, though... but then again even
scrolling around felt sluggish with that much text in the Workspace. I
could have done that :%s/'/''/g in a proper text editor, but instead I
went crazy and grabbed the String from the TextMorph and wished to
move it out of that Object Explorer... Many ways to accomplish the
same thing, and a lot of them would probably have been more efficient
than asking for that feature I had in mind, granted.

In the end, or rather minutes after starting this thread, I solved my
text transfer problem by copying the XML and doing `xmlString :=
Clipboard clipboardText string`...

> I guess I see Workspaces for learning and discovery for newbies.
> Short, simple, explorations of syntax and class library.
>
> Attempting to do work as complex as parsing a large XML is going to
> present further challenges above and beyond accessing an object.  If
> someone feels the need to "link workspaces" they really should stop
> and consider just making a class.  In fact, I think linked workspaces
> would lead a newbie down the wrong path..

I was not going to write the parsing in the workspace, but I wanted to
conduct my experimenting from there, just like Karl said. And in the
beginning, I needed the XML as a String object, to put it into the
StAXParser, try out the parser API in the workspace and, eventually,
put the parser into my reading object for which I have written a
proper class, of course. :-)

Hence, I do not really feel the need for linked workspaces, but I
would like to move objects around the tools occasionally. That's why I
was delighted to be introduced to that dropped references feature. I
agree with the others that it would be convenient if the
TransferMorphs were unpacked automatically. IMHO, the usual assignment
semantics would suffice, no actual binding/referring to an instance
variable required. If I wanted to be up to date with the object's
state I would transfer that object itself and not an instance
variable.


More information about the Squeak-dev mailing list