Discuss Scratch

bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

I can't figure out how to get the current process.
OK, I'll look into it. Unless hm or jfb or somebody knows?

joefarebrother
Scratcher
500+ posts

Snap! user discussion

I think the expanded HTTP block in the library has a way to get the current process


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
liam48D
Scratcher
1000+ posts

Snap! user discussion

joefarebrother wrote:

I think the expanded HTTP block in the library has a way to get the current process



That's pretty cool.

202e-202e-202e-202e-202e UNI-CODE~~~~~
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

liam48D wrote:

joefarebrother wrote:

I think the expanded HTTP block in the library has a way to get the current process



That's pretty cool.
Oh, so the last argument passed to a JS procedure by the CALL block is the process? Great

Last edited by Jonathan50 (June 25, 2016 10:42:17)

bharvey
Scratcher
1000+ posts

Snap! user discussion

joefarebrother wrote:

I think the expanded HTTP block in the library has a way to get the current process
See, I knew Jonathan could rely on you!

birdoftheday
Scratcher
500+ posts

Snap! user discussion

Someone should replace the register machine language in SICP with Scratch. They're shockingly similar, in a way.

Am I the only person who likes 3.0 better than 2.0, or do the people who do just not talk about it?
joefarebrother
Scratcher
500+ posts

Snap! user discussion

That was my original idea for my scheme interpreter in Scratch.

Then it evolved to become based on the Snap! interpreter

Then I just took it in its own direction which bears resemblance to the metacircular evaluator in SICP but has become a bit messy, to deal with things like tail recursion


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

Is it ok if I make up properties and put them on proc.context? It works.
bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

Is it ok if I make up properties and put them on proc.context? It works.
Okay in what (sorry) context? Are you writing a JS Function for your own use, or are you fixing a bug that will lead to a pull request, or what? For private JS Function, of course, whatever works is fine. If you're going to propose it for a library, it better always work. But I don't think there's any problem in principle, given all the stuff hanging off there already (eg sounds).

Jonathan50
Scratcher
1000+ posts

Snap! user discussion

bharvey wrote:

Jonathan50 wrote:

Is it ok if I make up properties and put them on proc.context? It works.
Okay in what (sorry) context? Are you writing a JS Function for your own use, or are you fixing a bug that will lead to a pull request, or what? For private JS Function, of course, whatever works is fine. If you're going to propose it for a library, it better always work. But I don't think there's any problem in principle, given all the stuff hanging off there already (eg sounds).
As in bad stuff won't happen.
joefarebrother
Scratcher
500+ posts

Snap! user discussion

Jonathan50 wrote:

bharvey wrote:

Jonathan50 wrote:

Is it ok if I make up properties and put them on proc.context? It works.
Okay in what (sorry) context? Are you writing a JS Function for your own use, or are you fixing a bug that will lead to a pull request, or what? For private JS Function, of course, whatever works is fine. If you're going to propose it for a library, it better always work. But I don't think there's any problem in principle, given all the stuff hanging off there already (eg sounds).
As in bad stuff won't happen.
Yeah I don't think any code relies on there NOT being a certain property (if it did, that's horrible design), but I'd advise to read the code just to make sure your property doesn't clash with any others (a CTRL-F in threads.js will probably suffice)


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
edward789121
Scratcher
500+ posts

Snap! user discussion

how do i get the url for my shared project?

Last edited by edward789121 (June 27, 2016 21:00:56)


my website go there if you want information about me.
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

I'm trying to write a metacircular interpreter in Snap!, and so far I can run a single script without reporters like
when gf clicked
go to x: (0) y: (0)
move (30) steps
(those are the only blocks currently) The project is here.

Here's the script XML:
<script x="30" y="37"><block s="receiveGo"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="forward"><l>30</l></block></script>

EDIT: Reporters, +, and SAY FOR SECS are working
when gf clicked
say [3 + 2 is…] for (1) secs
say ((3) + (2)) for (1) secs
<script x="20" y="20"><block s="receiveGo"></block><block s="doSayFor"><l>3 + 2 is…</l><l>1</l></block><block s="doSayFor"><block s="reportSum"><l>3</l><l>2</l></block><l>1</l></block></script>

Last edited by Jonathan50 (July 3, 2016 04:44:51)

djdolphin
Scratcher
1000+ posts

Snap! user discussion

In BYOB, clicking the green flag stops previously running scripts and resets the pause button before triggering green flag scripts, but Snap! doesn't seem to do this. BYOB also prevents you from triggering scripts by other methods while a project is paused, but Snap! doesn't. Is there a reason for these changes? It seems pretty unintuitive, because by doing either of these things, you end up with a project that is supposedly paused, yet still has scripts running.

!
bharvey
Scratcher
1000+ posts

Snap! user discussion

edward789121 wrote:

how do i get the url for my shared project?
When you open the project, the URL is in your browser URL bar.

bharvey
Scratcher
1000+ posts

Snap! user discussion

djdolphin wrote:

In BYOB, clicking the green flag stops previously running scripts and resets the pause button before triggering green flag scripts, but Snap! doesn't seem to do this. BYOB also prevents you from triggering scripts by other methods while a project is paused, but Snap! doesn't. Is there a reason for these changes? It seems pretty unintuitive, because by doing either of these things, you end up with a project that is supposedly paused, yet still has scripts running.
If I were going to change anything about the interaction of green flag vs. pause, it'd be that green flag with pause down just undoes pause and nothing else – I think it's an easy mistake to make to try to unpause that way.

Jens is very big on the importance of the active interface – there's no real stopped state, and you can always create and run scripts. We made a compromise to that principle for the generic WHEN block, which is disabled when you hit stop, to prevent unstoppable runaway scripts with WHEN TRUE or something. But I'm not surprised when you say that pause doesn't prevent new things happening. I guess I'm mostly on your side about it, but I can also sort of imagine wanting to run a script that goes through a big data structure checking for inconsistencies or something while paused. (Saying it another way, Snap! is its own debugger.)

bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

I'm trying to write a metacircular interpreter in Snap!
Cool. Is that XML what you get when you export a project?

Looking forward to lambda and custom blocks.

Jonathan50
Scratcher
1000+ posts

Snap! user discussion

bharvey wrote:

Jonathan50 wrote:

I'm trying to write a metacircular interpreter in Snap!
Cool. Is that XML what you get when you export a project?

Looking forward to lambda and custom blocks.
Thanks! The XML is a script tag from exporting a project. (It only works with single scripts.)
bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

(It only works with single scripts.)
Ah. Also looking forward to your call/cc thread manager!

Jonathan50
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

I'm trying to write a metacircular interpreter in Snap!
I added rings for reporters with only explicit parameters (no implicit parameters yet):

<script x="20" y="20"><block s="receiveGo"></block><block s="doSayFor"><block s="evaluate"><block s="evaluate"><block s="reifyReporter"><autolambda><block s="reifyReporter"><autolambda><block s="reportSum"><block var="x"/><block var="y"/></block></autolambda><list><l>y</l></list></block></autolambda><list><l>x</l></list></block><list><l>3</l></list></block><list><l>3</l></list></block><l>2</l><comment w="90" collapsed="true">6</comment></block></script>

EDIT: Added rings for scripts which don't report anything (no report block yet) and predicates.

Last edited by Jonathan50 (July 3, 2016 08:26:08)

Powered by DjangoBB

Standard | Mobile