Steve Thomas | 1 Feb 2012 01:04

Re: [etoys-dev] sixteen items for Squeakland 2012 - item 7: Single step debugger

Okay, so I realize this is not a simple request, but ...
Can we have a Step Backward in addition to Step forward?
 
Like in the Online Python Tutor (which is really cool in helping make the invisible visible and giving kids an idea of what is going on inside the computer).
 
Stephen
 

 
On Tue, Jan 31, 2012 at 6:04 PM, karl ramberg <karlramberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:


On Tue, Jan 31, 2012 at 11:39 PM, Ricardo Moran <richi.moran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

On Wed, Jan 25, 2012 at 2:17 AM, Scott Wallace <scott.wallace-tgy29QT0A092KDkfy0k2sw@public.gmane.org> wrote:
7. Single Step Debugger

Hi, I made a new picture for the step button in the script editors. A new project is attached for you to test and review.

The new button looks like this: 

and the old one:

Of course, it's up to you to decide which form to use (or propose a new one).
I don't really care much for the button's form anyway, but I'm *very* interested in the "stepping" feature.

New button is nice. but it must have a little bigger gap between the triangle and the line.
See scaled screen cap where the two elements blend together.

But we also have the ! button. And the Step button in the AllScriptsTool

Should we add a new button for single stepping or should we repurpose a old button ?

Karl
 
 

_______________________________________________
squeakland mailing list
squeakland-tgy29QT0A092KDkfy0k2sw@public.gmane.org
http://lists.squeakland.org/mailman/listinfo/squeakland


_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland
Ricardo Moran | 1 Feb 2012 15:04
Picon
Gravatar

Re: [etoys-dev] sixteen items for Squeakland 2012 - item 7: Single step debugger



On Tue, Jan 31, 2012 at 8:04 PM, karl ramberg <karlramberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
(...) 
New button is nice. but it must have a little bigger gap between the triangle and the line.
See scaled screen cap where the two elements blend together.

How about now? I made the gap 2 pixels wide.
 

But we also have the ! button. And the Step button in the AllScriptsTool

Should we add a new button for single stepping or should we repurpose a old button ?

I think the ! button serves a different purpose and we can't use it, and IMHO the Step button in the AllScriptsTool looks really ugly on the script editor :)

If we are going to reuse an old button, I think the book's next page looks quite nice.

Cheers,
Richo
 

Karl
 
 

Attachment (StepOver.003.pr): application/octet-stream, 68 KiB
_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland
Ricardo Moran | 1 Feb 2012 15:09
Picon
Gravatar

Re: [etoys-dev] sixteen items for Squeakland 2012 - item 7: Single step debugger


On Tue, Jan 31, 2012 at 9:04 PM, Steve Thomas <sthomas1 <at> gosargon.com> wrote:
Okay, so I realize this is not a simple request, but ...
Can we have a Step Backward in addition to Step forward?

I think it can be done, we should find a way to undo the last tile. I know Etoys has an undo feature but I never looked at it and I don't know if it works, maybe we can reuse it.
 
 
Like in the Online Python Tutor (which is really cool in helping make the invisible visible and giving kids an idea of what is going on inside the computer).

Nice! I didn't know about it

Cheers,
Richo
 
 
Stephen
 

 
On Tue, Jan 31, 2012 at 6:04 PM, karl ramberg <karlramberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:


On Tue, Jan 31, 2012 at 11:39 PM, Ricardo Moran <richi.moran <at> gmail.com> wrote:

On Wed, Jan 25, 2012 at 2:17 AM, Scott Wallace <scott.wallace-tgy29QT0A092KDkfy0k2sw@public.gmane.org> wrote:
7. Single Step Debugger

Hi, I made a new picture for the step button in the script editors. A new project is attached for you to test and review.

The new button looks like this: 

and the old one:

Of course, it's up to you to decide which form to use (or propose a new one).
I don't really care much for the button's form anyway, but I'm *very* interested in the "stepping" feature.

New button is nice. but it must have a little bigger gap between the triangle and the line.
See scaled screen cap where the two elements blend together.

But we also have the ! button. And the Step button in the AllScriptsTool

Should we add a new button for single stepping or should we repurpose a old button ?

Karl
 
 

_______________________________________________
squeakland mailing list
squeakland <at> squeakland.org
http://lists.squeakland.org/mailman/listinfo/squeakland



_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland
Steve Thomas | 1 Feb 2012 22:24

If I create a text string which contains squeak code, how can I execute it from within a script?

Folks,

I am trying to create a project where kids can enter their own "Connector" functions.

So what I want to do is given a connector connected to two text boxes (one Enhanced Text, so I can execute a script when they hit <CR> or on <focus loss>).
I have a string variable defined for the connector, in which the kids can enter a function like ( D = S + 25)
Where D maps to DestinationPlayer and S maps to SourcePlayer.

Ideally I would like to generate the below script and execute it:

doIt
self getDestinationPlayer setNumericValue: self getSourcePlayer getNumericValue + 25


Need some squeak coding help on this.  I guess specifically, assuming I can figure out how to create a string with the correct code ...
How do I "do it" to the string?

Thanks,
Stephen
Attachment (ConnectorMath.001.pr): application/octet-stream, 92 KiB
_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland
Bert Freudenberg | 1 Feb 2012 22:53
Picon
Gravatar

Re: [etoys-dev] If I create a text string which contains squeak code, how can I execute it from within a script?


On 01.02.2012, at 13:24, Steve Thomas wrote:

> Folks,
> 
> I am trying to create a project where kids can enter their own "Connector" functions.
> 
> So what I want to do is given a connector connected to two text boxes (one Enhanced Text, so I can execute a
script when they hit <CR> or on <focus loss>).
> I have a string variable defined for the connector, in which the kids can enter a function like ( D = S + 25)
> Where D maps to DestinationPlayer and S maps to SourcePlayer.
> 
> Ideally I would like to generate the below script and execute it:
> 
> doIt
> 	self getDestinationPlayer setNumericValue: self getSourcePlayer getNumericValue + 25
> 
> 
> Need some squeak coding help on this.  I guess specifically, assuming I can figure out how to create a string
with the correct code ...
> How do I "do it" to the string?

Compiler evaluate: '3 + 4'

- Bert -
karl ramberg | 1 Feb 2012 23:03
Picon

Re: [etoys-dev] sixteen items for Squeakland 2012 - item 7: Single step debugger

On Wed, Feb 1, 2012 at 3:04 PM, Ricardo Moran <richi.moran@...> wrote:
>
>
> On Tue, Jan 31, 2012 at 8:04 PM, karl ramberg <karlramberg@...> wrote:
> (...)
>>
>> New button is nice. but it must have a little bigger gap between the
>> triangle and the line.
>> See scaled screen cap where the two elements blend together.
>
>
> How about now? I made the gap 2 pixels wide.

Gap i nicer now when I scale down the screen.

>
>>
>>
>> But we also have the ! button. And the Step button in the AllScriptsTool
>>
>> Should we add a new button for single stepping or should we repurpose a
>> old button ?
>
>
> I think the ! button serves a different purpose and we can't use it, and
> IMHO the Step button in the AllScriptsTool looks really ugly on the script
> editor :)

Yaeh, some og the old widgets look a bit strange.
I think we can use the buttons asthey are..

>
> If we are going to reuse an old button, I think the book's next page looks
> quite nice.
>

I tested one edge case that we have to look at.
The World viewer has a value 'batch pentrails'.

When that is true, the script just pit the player at the last position
in the script.

The stepper goes trough each line, so the result differs.

So a script:

car forward: 50
car turn: 90
car forward: 50
car turn: 90
car forward: 50
car turn: 90
car forward: 50
car turn: 90

You will get different results for single stepping and other execution
of that method.

Karl
karl ramberg | 1 Feb 2012 23:10
Picon

Re: [etoys-dev] If I create a text string which contains squeak code, how can I execute it from within a script?

On Wed, Feb 1, 2012 at 10:24 PM, Steve Thomas <sthomas1@...> wrote:
> Folks,
>
> I am trying to create a project where kids can enter their own "Connector"
> functions.
>
> So what I want to do is given a connector connected to two text boxes (one
> Enhanced Text, so I can execute a script when they hit <CR> or on <focus
> loss>).
> I have a string variable defined for the connector, in which the kids can
> enter a function like ( D = S + 25)
> Where D maps to DestinationPlayer and S maps to SourcePlayer.
>
> Ideally I would like to generate the below script and execute it:
>
> doIt
> self getDestinationPlayer setNumericValue: self getSourcePlayer
> getNumericValue + 25
>
>
>
> Need some squeak coding help on this.  I guess specifically, assuming I can
> figure out how to create a string with the correct code ...
> How do I "do it" to the string?
>
> Thanks,
> Stephen
>
> _____

I have also wanted a enhanced workspace where one evaluate a line with
enter/return.
Workspaces create textual references to dropped morphs, see workspace
window menus.
That way you can keep track of many morphs on screen.
Evaluation is done by select and Ctr l+ D

Karl
Bert Freudenberg | 1 Feb 2012 23:23
Picon
Gravatar

Re: [etoys-dev] If I create a text string which contains squeak code, how can I execute it from within a script?


On 01.02.2012, at 13:53, Bert Freudenberg wrote:

> 
> On 01.02.2012, at 13:24, Steve Thomas wrote:
> 
>> Folks,
>> 
>> I am trying to create a project where kids can enter their own "Connector" functions.
>> 
>> So what I want to do is given a connector connected to two text boxes (one Enhanced Text, so I can execute a
script when they hit <CR> or on <focus loss>).
>> I have a string variable defined for the connector, in which the kids can enter a function like ( D = S + 25)
>> Where D maps to DestinationPlayer and S maps to SourcePlayer.
>> 
>> Ideally I would like to generate the below script and execute it:
>> 
>> doIt
>> 	self getDestinationPlayer setNumericValue: self getSourcePlayer getNumericValue + 25
>> 
>> 
>> Need some squeak coding help on this.  I guess specifically, assuming I can figure out how to create a
string with the correct code ...
>> How do I "do it" to the string?
> 
> 
> Compiler evaluate: '3 + 4'
> 
> - Bert -

... and to be a bit less brief, a simple way to introduce variables is compiling a block:

	(Compiler evaluate: '[:a :b | a + b ]') value: 3 value: 4

Also see attached your project, enhanced.

[I'd get rid of the D and S and the assignment, just have the kids enter "x + 25". Makes the veal code simpler.
Also, watch out for "3 + 4 * 5" having not the same result as when using Etoys tiles. The way around that would
be to implement an actual grammar for your functions, not just re-use the Smalltalk grammar]

- Bert -

Attachment (ConnectorMath.002.pr): application/x-squeak-project, 49 KiB
_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland
Steve Thomas | 2 Feb 2012 06:20

Re: [etoys-dev] If I create a text string which contains squeak code, how can I execute it from within a script?

Thanks Bert!!!

... and to be a bit less brief, a simple way to introduce variables is compiling a block:

       (Compiler evaluate: '[:a :b | a + b ]') value: 3 value: 4
Also see attached your project, enhanced.
 
[I'd get rid of the D and S and the assignment, just have the kids enter "x + 25". Makes the veal code simpler. Also, watch out for "3 + 4 * 5" having not the same result as when using Etoys tiles. The way around that would be to implement an actual grammar for your functions, not just re-use the Smalltalk grammar]

Good idea.  I made the changes and am playing around with Compiler evaluate.


_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland
Ricardo Moran | 2 Feb 2012 21:40
Picon
Gravatar

Re: [etoys-dev] sixteen items for Squeakland 2012 - item 7: Single step debugger

On Wed, Feb 1, 2012 at 7:03 PM, karl ramberg <karlramberg <at> gmail.com> wrote:

I tested one edge case that we have to look at.
The World viewer has a value 'batch pentrails'.

When that is true, the script just pit the player at the last position
in the script.

The stepper goes trough each line, so the result differs.

So a script:

car forward: 50
car turn: 90
car forward: 50
car turn: 90
car forward: 50
car turn: 90
car forward: 50
car turn: 90

You will get different results for single stepping and other execution
of that method.

Good catch! I never used the batch pen trails option, I didn't even know about its existence!

I have no clue how to fix it, though. Any suggestion?

Richo
 

Karl

_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland

Gmane