[suggestion]Drilling down into blocks

Extending or modifying the GP system itself (advanced!)

Moderator: MSandro

Post Reply
SimpleSi
Posts: 330
Joined: Jul 2nd, '17, 13:47

[suggestion]Drilling down into blocks

Post by SimpleSi » Aug 1st, '17, 20:58

To make my Scratch 1.4 broadcast mechanism, I had to do a lot of looking at text methods in runtime/lib - then copying them into the workspace - blockifying them - then modifying them - it took a lot of work :)

(But quite educational obviously)

But I feel that there should/could be a better way :)

The easiest (from my point of view) would be the ability to "drill-down" into a top-level block and extract the blocks that make it up

A second method (but not as easy to use for me but might be very quick to implement) would be access to ALL GP primitive blocks (such as byteAtPut etc)

While typing this I paused and had a look around and found the Methods Palette :)

But although all the GP blocks would seem to be in there - I couldn't actually find byteatPut, so either I need to look harder or it isn't there

But using the Methods Palette (which is a LOT better than nothing) I feel what I really want is the drill down approach

Actually, prob what I'm after is an "expand" or "explode" facility to make the internal blocks of any blocks visible - down to the GP primitive level

Simon

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: [suggestion]Drilling down into blocks

Post by JohnM » Aug 3rd, '17, 23:32

Hi, Simon.

Wow! You've gone way past the part of GP that's polished and into part of GP that is still being implemented -- the stuff deep inside "developer mode".

My plan for this year plan is to get GP out as a Scratch-like programming system so students and teachers who are ready to go beyond what Scratch can start using it. That part of the system is fairly complete, has been tested with at least a few real users, and has a growing set of resources devoted to it on the GP website.

But while folks are using the Scratch-like side of GP this school year, we'll keep working on it's "behind the scenes" developer mode tools -- which are far from complete, not polished, and definitely not documented! It's very heartening to have folks like you already diving into those waters and succeeding in spite of the fact that things are not even close to ready. It is also very helpful to see what you manage to do and where you get stuck due to lack of documentation or missing features.

So, here's one missing bit of documentation: in addition to all the code written in GP, there are are a set of commands and functions that are built into the GP virtual machine. As an example, the socket commands you used are built in.

Fortunately, a tiny bit of documentation for the built-in commands is also built right into the virtual machine! If you blockify and run:

Code: Select all

showText (help)
you'll get a list of all the built-in commands and functions. You can get more info about a particular function by doing (for example):

Code: Select all

(help 'openClientSocket')

SimpleSi
Posts: 330
Joined: Jul 2nd, '17, 13:47

Re: [suggestion]Drilling down into blocks

Post by SimpleSi » Aug 4th, '17, 09:00

Thanks for the info - very useful :)

I just need to write a GP script to blockify all of them and then turn it into a app :)


Fine on GP direction - the stuff I'm doing with this is advanced - just would save me/anyone doing this sort of stuff a lot of copying/pasting/blockifying :)

The reason for doing this type of work is to produce GP extensions that less advanced GPers can use in their own projects - equivalent of writing a python module that can just be imported and used

So I'm hoping to make a few functions to do stuff and then hopefully I can persuade you to turn them into a official high-level GP block if they have sufficient merit :)

Post Reply