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.
Offline
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
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.
Offline
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
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"!
But I bet you know more about computers than I know about history!
Offline
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 .
Offline
rubiks_cube_guy238 wrote:
Now we're famous .
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.
Offline
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).
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
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?
Offline
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!
Offline
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...
Offline
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.
Offline
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 ) 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?
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.)
Offline
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?
Offline
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?
Offline
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!!!!! (i tested with five sprites)
Offline
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!
Offline
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
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!
Offline
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
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.
Johnhmm, 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
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)
Offline
I'm sorry to hear you're sick. Feel better Brian!
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