Feature Request: unary selector on String hierarchy to open a workspace on the string

37 views
Skip to first unread message

Richard Sargent

unread,
Aug 5, 2019, 2:45:44 PM8/5/19
to VA Smalltalk
 The number of times that I have wished for a simple way to open a workspace showing the contents of a string (in an inspector or from a script, etc.) is beyond my ability to count.

A simple selector such as #edit in a development application would be a truly welcome enhancement.

Louis LaBrunda

unread,
Aug 5, 2019, 5:19:14 PM8/5/19
to VA Smalltalk
Hi Richard,

You mean like:

'xyz' inspect

?

Lou
Message has been deleted

Richard Sargent

unread,
Aug 5, 2019, 5:33:19 PM8/5/19
to VA Smalltalk


On Monday, August 5, 2019 at 2:19:14 PM UTC-7, Louis LaBrunda wrote:
Hi Richard,

You mean like:

'xyz' inspect

I'm not sure if you are telling me that #inspect is what I should be using. That example is so simple that it doesn't illustrate the problems that an inspector presents.

My examples are more along the lines of
| stream |
stream := WriteStream on: String new.
... some elaborate sequence producing a large amount of information ...
stream contents inspect

stream contents edit would be preferable, especially when the contents include quotes or is something you would like to save to a file or otherwise manipulate further, including paste into a spread sheet.

Louis LaBrunda

unread,
Aug 6, 2019, 7:17:10 AM8/6/19
to VA Smalltalk
On Monday, August 5, 2019 at 5:33:19 PM UTC-4, Richard Sargent wrote:


On Monday, August 5, 2019 at 2:19:14 PM UTC-7, Louis LaBrunda wrote:
Hi Richard,

You mean like:

'xyz' inspect

I'm not sure if you are telling me that #inspect is what I should be using.

I was a little.
 
That example is so simple that it doesn't illustrate the problems that an inspector presents.

My examples are more along the lines of
| stream |
stream := WriteStream on: String new.
... some elaborate sequence producing a large amount of information ...
stream contents inspect

stream contents edit would be preferable, especially when the contents include quotes or is something you would like to save to a file or otherwise manipulate further, including paste into a spread sheet.

I'm trying to picture what the contents of the edit would look like.

Richard Sargent

unread,
Aug 6, 2019, 12:09:46 PM8/6/19
to VA Smalltalk


On Tuesday, August 6, 2019 at 4:17:10 AM UTC-7, Louis LaBrunda wrote:
On Monday, August 5, 2019 at 5:33:19 PM UTC-4, Richard Sargent wrote:


On Monday, August 5, 2019 at 2:19:14 PM UTC-7, Louis LaBrunda wrote:
Hi Richard,

You mean like:

'xyz' inspect

I'm not sure if you are telling me that #inspect is what I should be using.

I was a little.
 
That example is so simple that it doesn't illustrate the problems that an inspector presents.

My examples are more along the lines of
| stream |
stream := WriteStream on: String new.
... some elaborate sequence producing a large amount of information ...
stream contents inspect

stream contents edit would be preferable, especially when the contents include quotes or is something you would like to save to a file or otherwise manipulate further, including paste into a spread sheet.

I'm trying to picture what the contents of the edit would look like.

So am I!!

Here is an example from GBS.

    | ws |
    ws := EtWorkspace new.
    ws open nextPutAll: config printString.
    ws confirmClose: false "don't show changes unless the user makes a change"

And here is an example from EpPackagingInstructions.

    (EtWorkspace new
        label: MxEPf368 , Date dateAndTimeNow printString;  "$NLS$ Packager Instructions"
        open;
        nextPutAll: ws contents;
        yourself)
            textWidget
                showPosition: 0

So, yes. We could continue writing such abominable expressions. I would prefer to have the product provide a standard and concise way to do this.

Seth Berman

unread,
Aug 6, 2019, 2:47:05 PM8/6/19
to va-sma...@googlegroups.com
Hi All,

You could certainly dispatch a method in String back to an already existing method which is pretty terse already:
EtWorkspace stsPrompt: '' default: self
or
StsWorkspace stsPrompt: '' default: self

You may need an additional variant of the String method to capture an optional workspace title.
so you could actually include an optional title for the workspace.
EtWorkspace stsPrompt: aTitle default: self.
or
StsWorkspace stsPrompt: aTitle default: self.

- Seth

Richard Sargent

unread,
Aug 6, 2019, 3:55:04 PM8/6/19
to VA Smalltalk
On Tue, Aug 6, 2019 at 11:47 AM 'Seth Berman' via VA Smalltalk <va-sma...@googlegroups.com> wrote:
Hi All,

You could certainly dispatch something a method in String back to an already existing method which is pretty terse already:
EtWorkspace stsPrompt: '' default: self
or
StsWorkspace stsPrompt: '' default: self

You may need an additional variant of the String method to capture an optional workspace title.
so you could actually include an optional title for the workspace.
EtWorkspace stsPrompt: aTitle default: self.
or
StsWorkspace stsPrompt: aTitle default: self.

Thanks, Seth. That works. I wasn't aware of its existence.

The modal nature probably won't interfere in my normal use patterns, so it should be fine.


--
You received this message because you are subscribed to a topic in the Google Groups "VA Smalltalk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/va-smalltalk/56kNHfbNZj0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to va-smalltalk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/va-smalltalk/25161e14-48dc-4cd1-a702-a3be07717d9a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages