Workspace Problem: Mixing up Context

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Workspace Problem: Mixing up Context

ChanHong Kim
Hi Andy/Blair.

The very powerful facility of the Workspace in DX6 is 'dynamic syntax
coloring' which is very helpful in CHB or SB. However, it is used in
normal Workspace, it is encountered to "Mixing-up Context" Problem.

The Workspace is used to test some snipets of code and display its
results, so there is many meaningles character and many context which
is possesed by small snipets of code. But current syntax-coloring
doesn't care these situation.

"Mixing-up Context" problem has following cosmetic operation in
Workspace:

1) incorrectly colored text
2) Doesn't appear 'auto-completion' suggestion window

Let me show some examples.

1) In Workspace, type and Display-It.

    3 + 4.    7

On the next line, type

    Obj

and press [Ctrl+.] to invoke 'auto-completion', it isn't operate
correctly.
(It should suggest "Object" class-name). Furthermore, 'Object' is
colored blue instead of Black because the analyzer consider that
'Object' is message instead of 'class name'.

This situation can be solved with putting period in the end of results
like this:

    3 + 4.    7.

The period character break and start new context.

2) Please type following expression:

    3 + 4.

On next line, type:

    | a |

I'd like snipet of some statements in a method. But the vertical-bar(|)
character is colored to Blue instead of Black, and auto-completion
doesn't suggest 'a' variable name.

This situation can't be solved any way because the period character can
start new context of statement, but cant't start context of whole
snipete of code.


The solution of theese problem is providing "Break context facility"
like "Break page facility" in Microsoft Word.

When I use MS Word, I can break and new page with typing [Ctrl-Enter]
key, and then I can see the line of breaking-page, so I can recognize
that the page is breaking.

If I write some code and evaluate it and type [Ctrl-Enter](or some
key-combination)  in normal Workspace, the breaking line is drawn and
start new context.

These facility is greate way to Smalltalker who use Workspace to their
'sketchbook' in DX6.

What do you think about these problem and solution?
Please comment about it.

Best regards!

p.s.: My mother-language isn't English. Please pardon.


Reply | Threaded
Open this post in threaded view
|

Re: Workspace Problem: Mixing up Context

Blair McGlashan-3
"ChanHong Kim" <[hidden email]> wrote in message
news:[hidden email]...

> Hi Andy/Blair.
>
> The very powerful facility of the Workspace in DX6 is 'dynamic syntax
> coloring' which is very helpful in CHB or SB. However, it is used in
> normal Workspace, it is encountered to "Mixing-up Context" Problem.
>
> The Workspace is used to test some snipets of code and display its
> results, so there is many meaningles character and many context which
> is possesed by small snipets of code. But current syntax-coloring
> doesn't care these situation.
>
> "Mixing-up Context" problem has following cosmetic operation in
> Workspace:
>
> 1) incorrectly colored text
> 2) Doesn't appear 'auto-completion' suggestion window

Well of course these things cannot work correctly if the text is not at
least lexically valid, and in some cases syntactically valid. There is an
awful lot of ambiguity in the Smalltalk language (it being so simple), so
even the colouring of the text requires some level of syntax analysis.

>
> Let me show some examples.
>
> 1) In Workspace, type and Display-It.
>
>    3 + 4.    7
>
> On the next line, type
>
>    Obj
>
> and press [Ctrl+.] to invoke 'auto-completion', it isn't operate
> correctly.
> (It should suggest "Object" class-name). Furthermore, 'Object' is
> colored blue instead of Black because the analyzer consider that
> 'Object' is message instead of 'class name'.

No, it shouldn't because syntactically you are sending the message Obj to 7.
That may not be what you mean, but it is what you are saying.

>
> This situation can be solved with putting period in the end of results
> like this:
>
>    3 + 4.    7.
>
> The period character break and start new context.

Absolutely. So the solution in this case is to put in a period to break into
a new statement.

>
> 2) Please type following expression:
>
>    3 + 4.
>
> On next line, type:
>
>    | a |
>
> I'd like snipet of some statements in a method. But the vertical-bar(|)
> character is colored to Blue instead of Black, and auto-completion
> doesn't suggest 'a' variable name.
>
> This situation can't be solved any way because the period character can
> start new context of statement, but cant't start context of whole
> snipete of code.

True.

>
> The solution of theese problem is providing "Break context facility"
> like "Break page facility" in Microsoft Word.
>
> When I use MS Word, I can break and new page with typing [Ctrl-Enter]
> key, and then I can see the line of breaking-page, so I can recognize
> that the page is breaking.
>
> If I write some code and evaluate it and type [Ctrl-Enter](or some
> key-combination)  in normal Workspace, the breaking line is drawn and
> start new context.
>
> These facility is greate way to Smalltalker who use Workspace to their
> 'sketchbook' in DX6.
>
> What do you think about these problem and solution?
> Please comment about it.

Its a good idea, but the problem is how to then save/restore a script as
syntactically valid. I suppose one solution would be to take the approach of
something like Excel and allow you to save it in different forms. Pure text
(st file) form would lose this extra information, but the default would be
to save it with special characters marking the breaks.

I'll certainly record it as an enhancement request, but it won't be in PL1.

Thanks for your suggestion

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Workspace Problem: Mixing up Context

Chris Uppal-3
Blair McGlashan wrote:

> Its a good idea, but the problem is how to then save/restore a script as
> syntactically valid. I suppose one solution would be to take the approach
> of something like Excel and allow you to save it in different forms. Pure
> text (st file) form would lose this extra information, but the default
> would be to save it with special characters marking the breaks.
>
> I'll certainly record it as an enhancement request, but it won't be in
> PL1.

Wouldn't it be a good deal easier, and /almost/ as effective, to make the
code-completion start parsing at the last preceding occurrence of a
non-whitespace character in column 1 ?

    -- chris