This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#2351 2011-01-10 20:06:32

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

Not sure how I feel about having a windows share open to the internet...

Oh, you restrict it to your LAN.  That's not a problem.  You can have belt-and-suspenders security by blocking SMB at your school or district firewall.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2352 2011-01-11 07:45:55

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

clintonhackers wrote:

Not sure how I feel about having a windows share open to the internet...

Oh, you restrict it to your LAN.  That's not a problem.  You can have belt-and-suspenders security by blocking SMB at your school or district firewall.

... but unfortunately my server is over at my day job, at the University.

Offline

 

#2353 2011-01-11 09:58:17

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

... but unfortunately my server is over at my day job, at the University.

Ah, you have a day job.  In that case you have to read the fine print in the documentation -- you're past my level of expertise!  Sorry.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2354 2011-01-11 17:04:45

clintonhackers
Scratcher
Registered: 2010-04-27
Posts: 20

Re: BYOB 3 - Discussion Thread

bharvey wrote:

clintonhackers wrote:

... but unfortunately my server is over at my day job, at the University.

Ah, you have a day job.  In that case you have to read the fine print in the documentation -- you're past my level of expertise!  Sorry.

well, my day job is teaching history, so I'm not sure THAT'S true!  But yes, I'll give it a whirl some time. 
thanks Brian
matt

Offline

 

#2355 2011-01-11 22:04:26

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

well, my day job is teaching history, so I'm not sure THAT'S true!

Ah, what I actually meant was, "your problem is beyond my level of expertise"!  smile

But I bet you know more about computers than I know about history!


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2356 2011-01-12 12:34:14

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: BYOB 3 - Discussion Thread

Hey, peoples, look at this.
In the first few frames, you can see BYOB as one of the selections on his screen! Now we're famous  tongue .


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#2357 2011-01-12 14:05:32

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

rubiks_cube_guy238 wrote:

Now we're famous  tongue .

Cool!  Do we know that guy?

There's a scene in Star Wars where they're flying through space and nothing is going to happen for a while, and you can see down in the corner of the control board a breakout game, or Space Invaders, or one of those oldies, and I always used to lust after having a picture of someone running Logo up there instead.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2358 2011-01-12 22:01:06

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hmmm... that new dev BYOB version for inheritance looks really interesting... Except every time I try to use it I get an error (or maybe I'm just doing something wrong).
http://i55.tinypic.com/2cqbqk9.png
All I do is open up BYOB, create a new sprite (just a black dot), right click, select "prototype", and finally "sprite 1" (default Alonzo).

I just skimmed over the email, so I'm sorry if I missed something important in it and my error is out of sheer ignorance. (Just wanted to check that it wasn't before I submitted it to the bugs site).

Offline

 

#2359 2011-01-12 23:58:03

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

Hmmm... that new dev BYOB version for inheritance looks really interesting... Except every time I try to use it I get an error (or maybe I'm just doing something wrong).
http://i55.tinypic.com/2cqbqk9.png
All I do is open up BYOB, create a new sprite (just a black dot), right click, select "prototype", and finally "sprite 1" (default Alonzo).

I just skimmed over the email, so I'm sorry if I missed something important in it and my error is out of sheer ignorance. (Just wanted to check that it wasn't before I submitted it to the bugs site).

Wait, "prototype"?!? Am I missing something? What version do you have?


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#2360 2011-01-13 00:02:08

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

shadow_7283 wrote:

Hmmm... that new dev BYOB version for inheritance looks really interesting... Except every time I try to use it I get an error (or maybe I'm just doing something wrong).
http://i55.tinypic.com/2cqbqk9.png
All I do is open up BYOB, create a new sprite (just a black dot), right click, select "prototype", and finally "sprite 1" (default Alonzo).

I just skimmed over the email, so I'm sorry if I missed something important in it and my error is out of sheer ignorance. (Just wanted to check that it wasn't before I submitted it to the bugs site).

Wait, "prototype"?!? Am I missing something? What version do you have?

Wow! I posted that yesterday!  yikes


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#2361 2011-01-13 00:27:25

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

MathWizz wrote:

Wait, "prototype"?!? Am I missing something? What version do you have?

Jens just emailed out a (very experimental!) first version to play with.  I've been in bed sick so haven't read my emil until just now...  Give me a moment...


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2362 2011-01-13 00:46:10

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

Except every time I try to use it I get an error

Okay, first reported bug award.  There has to be at least one "for this sprite only" block in the parent (the prototype) before you set up the connection.

I think I get the second bug... Once you do have a local block, it doesn't show up in the child's palette -- unless of course I'm doing something wrong.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2363 2011-01-13 01:00:39

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Okay, MathWizz, here it is...

But it really still is pretty broken; only desperately curious people should try it at this point.  Knowing Jens, there will be a much better release in a few days.

Jens wrote:

So, this is the very first experiment with adding built-in OOP to Scratch/BYOB. It's a simple prototype based inheritance model, and it works (well, I'm sure eventually it'll work  smile  ) like this:

Each sprite can be instantiated. Instantiation involves duplicating a sprite and delegating some of the duplicate's properties to the prototype. Inherited properties (how about we call them "traits" like in SELF?) can be overridden by the instance (polymorphism).

Please note that eventually there will be a specialized duplication routine for the instantiation process. If you duplicate a sprite right now assigning the "original" to be the duplicate's prototype will have none of the effects described below.

Inheritance really boils down to delegation, therefore you can omit the "duplicating" step, and also assign any sprite to be any other sprite's prototype, even exchanging prototypes later on. Inheritance is unlimited, there can be inheritance chains and "family trees".

The plan is to

    1. Make it work
    2. Make it accessible in the GUI
    3. Add blocks

This is the beginning of step 1 (make it work), so what little the GUI offers right now is just meant to provide some means of experimenting and debugging the model:

Right click on a sprite icon in the "corral" (the part underneath the stage) and select "prototype..." from the context menu. A new menu pops up indicating the sprite's current prototype and letting you select another one or remove the current prototype (clicking anywhere outside the menu closes it and leaves the current prototype assigned). Once you choose a prototype (another sprite), the prototype's

    - local variables
    - local lists
    - local custom blocks

are added to the instance's palettes, "local" meaning having been declared "for this sprite only".

Only the variable "slots" are inherited, not their values, these are independent of the prototype. Changing the prototype's variable has no effect on its instances. Once the instance stores something in an inherited variable removing the variable in the prototype also doesn't affect it anymore.

Inherited custom blocks, however, change their behavior, if their definition is changed in the prototype. So, editing a prototype's local block directly takes effect on all instances. But instances can override inherited block behavor by editing the inherited definition. Once an inherited block definition has been changed by an instance it becomes independent of the prototype's definition.

At some point we'll have a

    CALL / RUN <block> of PROTOTYPE

mechanism for SUPER and something else for SELF, so we can refine block definitions down the instance chain instead of havong to override them completely.

If you want to restore the default behavior for an instance's modified inherited block you can delete its block definition (the block stays in the palette, because it is inherited, only the modification gets deleted).

Get it?  wink

Oh, let me add the usual disclaimer: This is a first experiment so all kinds of other things will be broken, and saving projects that make use of these features is not yet supported.

Other than that, Enjoy!
--Jens

And here is the file.  (Note: there isn't a link to it on the BYOB web page.  It really isn't ready.)


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2364 2011-01-13 04:04:32

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Whoa, this first version wasn't meant to be a "release" or anything, just an exploratory setting out towards something I'm not yet completely sure about...

Thanks for the bug reports (you guys are great!). I got and fixed the first one (the prototype must have at least one local block), but can't reproduce the second one (prototype blocks don't show up in the instance's palette).

Anyway, this is way too early for debugging, we're still figuring out the concept. The big question, as Brian mentioned, is this: Which traits should be inheritable from the prototype. I'm starting with variables, lists and blocks. What about others (costumes, sounds, scripts, position, heading, size etc)? My first take on this is that unless overridden by the instance only changes to the prototype's local custom block definitions directly take effect on all instances. Is this enough? Any ideas?


Jens Mönig

Offline

 

#2365 2011-01-13 04:43:00

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

Jens wrote:

Anyway, this is way too early for debugging, we're still figuring out the concept. The big question, as Brian mentioned, is this: Which traits should be inheritable from the prototype. I'm starting with variables, lists and blocks. What about others (costumes, sounds, scripts, position, heading, size etc)? My first take on this is that unless overridden by the instance only changes to the prototype's local custom block definitions directly take effect on all instances. Is this enough? Any ideas?

I'm confused... so an instance will come out 'glued' to it's parent? And will receive all updated variables/lists from it's parent?


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2366 2011-01-13 04:50:46

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

@ Jens
Is there a block for prototyping in the elements editor? I like to hijack the 'distance to' block.


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2367 2011-01-13 05:15:08

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: BYOB 3 - Discussion Thread

Good news I just tested and It seems I can get multi layered inheritance of methods and Complete cascading variable inheritance... this is so exciting!!!!!    smile    (i tested with five sprites)


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#2368 2011-01-13 07:59:16

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

shadow_7283 wrote:

Hmmm... that new dev BYOB version for inheritance looks really interesting... Except every time I try to use it I get an error (or maybe I'm just doing something wrong).
http://i55.tinypic.com/2cqbqk9.png
All I do is open up BYOB, create a new sprite (just a black dot), right click, select "prototype", and finally "sprite 1" (default Alonzo).

I just skimmed over the email, so I'm sorry if I missed something important in it and my error is out of sheer ignorance. (Just wanted to check that it wasn't before I submitted it to the bugs site).

+1, I filed a bug report.

This is really incredible, though, once you get it to work!


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#2369 2011-01-13 11:56:37

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

Jens wrote:

Whoa, this first version wasn't meant to be a "release" or anything, just an exploratory setting out towards something I'm not yet completely sure about...

Which traits should be inheritable from the prototype. I'm starting with variables, lists and blocks. What about others (costumes, sounds, scripts, position, heading, size etc)? My first take on this is that unless overridden by the instance only changes to the prototype's local custom block definitions directly take effect on all instances. Is this enough? Any ideas?

A first good point : after "cloning" a method of the prototype is directly active for the cloned sprite. No need to SET it manually.

"What about...size etc). You should not take care of that considering that you can easily create a method (see my http://www.xleroy.net/ByobTuto/47-recap-06.html ) which sets whichever parameter you like. Concentrate your efforts on the essential ... you have so much to do !

Offline

 

#2370 2011-01-13 15:29:55

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

What about others (costumes, sounds, scripts, position, heading, size etc)?

I would have said that the easiest and best thing would be for the child to inherit everything until overridden, by just having a pointer to the parent that's followed for everything not explicitly shadowed.  Instead you seem to be suggesting a myriad of pointers for some pieces of the sprite, which is harder!


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2371 2011-01-13 15:31:53

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: BYOB 3 - Discussion Thread

P.S.  I'm not convinced that SET should be enough to override sharing.  If so, how do you make a class variable, that's settable by everyone in the class (all the siblings as well as the parent/prototype)?


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#2372 2011-01-13 17:46:46

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

Jens wrote:

Anyway, this is way too early for debugging, we're still figuring out the concept. The big question, as Brian mentioned, is this: Which traits should be inheritable from the prototype. I'm starting with variables, lists and blocks. What about others (costumes, sounds, scripts, position, heading, size etc)? My first take on this is that unless overridden by the instance only changes to the prototype's local custom block definitions directly take effect on all instances. Is this enough? Any ideas?

If you shared costumes would that mean that the 'sub' would wear costume 1 of the 'super', but have access to its own costumes, or wear its costume 1 but have access to the 'super's' costumes? The blocks would get very complicated wouldn't they? [switch to costume []], [switch to super costume []], ... Or am I misunderstanding what you are proposing?

To me, your first take has the right feel about it, but I haven't worked out a project that would use the prototyping so I'm not sure when/if I'd use the extra inheritable traits. The visual aspects of a sub sprite should surely be independent, although I think that scripts could be usefully inherited.

John

Last edited by jstout (2011-01-13 17:52:05)

Offline

 

#2373 2011-01-13 17:59:08

jstout
Scratcher
Registered: 2007-05-04
Posts: 39

Re: BYOB 3 - Discussion Thread

clintonhackers wrote:

jstout wrote:

Let me have your email and I'll send you the updated BYOB.image Ilia Avroutine and I are using (Brian, Jens: is this OK? I have a change set but not tested filing it in to a straight 3.08 image yet). It's based on 3.08 so it's up to date (about 4MB zipped). I haven't done much (well, any at all really) documentation but I'll knock something off quickly and include a few clone projects for you. The Files blocks were really so that Ilia could use BYOB in his GCSE teaching here in the UK.

John

hmm, interestingly there seems to be no way to send you my email privately!  it's .  And I'd be happy to put it on the web, as someone else asked I think.  If it's only a couple of MB I can just add it as a blog attachment if it helps.  Thanks John!

Matt

I've just sent it to you Matt. Have fun.

John

Offline

 

#2374 2011-01-13 19:26:39

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

so, how do you make a class variable, that's settable by everyone in the class (all the siblings as well as the parent/prototype)?

No problem, since we've got message-passing via the OF block:

Assuming the prototype's local var named FOO shall be settable by all instances, make a local block for the prototype named SET FOO TO num.

Then within the instance: RUN (SET FOO TO () OF prototype) WITH INPUTS (n) to set the prototype's FOO value. Use the light blue (FOO OF prototype) reporter to query the shared value.

Last edited by Jens (2011-01-13 19:30:28)


Jens Mönig

Offline

 

#2375 2011-01-13 20:04:43

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: BYOB 3 - Discussion Thread

I'm sorry to hear you're sick. Feel better Brian!  smile

I tried it again (doing it properly this time). It works! I'd love to see costumes included too.

Last edited by shadow_7283 (2011-01-13 20:04:57)

Offline

 

Board footer