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

#1276 2010-08-03 18:10:19

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

BYOB needs pointers.
Think: you can't make true linked lists without pointers. You can't pass variables to be changed within a block. It would be a simple, yet extremely powerful addition to BYOB.

(And I think a gold band would be nice  big_smile )


nXIII

Offline

 

#1277 2010-08-03 18:45:02

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

BYOB needs pointers.
Think: you can't make true linked lists without pointers.

No, not true.  The items in a list are already pointers!  You make pairs as (Scratch) lists of length two, where the first item is the element, and the second item is (a pointer to) the rest of the list (another pair, or the empty list).  There's no need to make that pointer explicit; it only confuses the issue and makes the code unreadable.  (In a real first-class-data environment, pointers are in effect the only data type, so the list (foo 27 (x y) ) has a pointer to the string foo, a pointer to the number 27, and a pointer to the list (x y) as its elements.  But since everything is a pointer, you never have to talk about pointers; the dereferencing happens automatically.)

You can't pass variables to be changed within a block.

Ah, here you are pointing (sorry) to a real problem, but I think you have the wrong solution.  You are asking BYOB programmers to think at a very low level of abstraction.  What we need (Jens, on the 3.n list) is downvars, which are like upvars only backwards.  In the custom block's picture in the palette is an empty orange blob, and the only thing you can drag onto it is an actual variable blob (or just maybe we'd allow an [ITEM n OF list] block), and inside the block's definition that input has a name, but whenever that name is used in the script, either in getter or setter form, it really refers to the outer variable.

But I have to say that as a functional programmer I would deplore such programming practice, so maybe it should go on the 3.99 list...  smile

It would be a simple, yet extremely powerful addition to BYOB.

It would be simple enough to implement, but to use it would take an intellectual leap that I think is about as high as the one for first class functions, or at least the one for recursive functions, and with much less payoff.

Last edited by bharvey (2010-08-03 18:45:44)


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

Offline

 

#1278 2010-08-04 04:34:36

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

- nested sprites

I've been far from BYOB for one month !
What about "nested" sprites ? Is it a new BYOB feature ? How can we use it ?

Offline

 

#1279 2010-08-04 05:38:55

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

Re: BYOB 3 - Discussion Thread

2.995.008, this time for sure...

Jens wrote:

after a long night of debugging, optimizing and frenzied testing a follow-up to yesterday's "final beta", this release sweeps up a minor (but awfully hard to track down) bug in the list setter code that prevented Brian's "streams" project to run to completion in this week's previous beta releases. Turns out fixing this bug and tweaking a few other things also and again speeds up some list operations, so now "streams" and "ttt" /does/ run a little faster again.


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

Offline

 

#1280 2010-08-04 07:49:53

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

You can't pass variables to be changed within a block.

Ah, here you are pointing (sorry) to a real problem

But yes, you can pass a LIST to be changed within a block!

Last edited by Jens (2010-08-04 07:50:26)


Jens Mönig

Offline

 

#1281 2010-08-04 07:58:12

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

Re: BYOB 3 - Discussion Thread

xly wrote:

What about "nested" sprites ? Is it a new BYOB feature ? How can we use it ?

Ah, that reminds me that I'm behind on documentation. Nested sprites have been introduced since BYOB2, and they are roughly explained in this document.


Jens Mönig

Offline

 

#1282 2010-08-04 22:08:48

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

Re: BYOB 3 - Discussion Thread

I have a sample project in progress here, any chance I could upload it in a few hours?


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

Offline

 

#1283 2010-08-04 22:18:46

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

xly wrote:

What about "nested" sprites ? Is it a new BYOB feature ? How can we use it ?

Ah, that reminds me that I'm behind on documentation. Nested sprites have been introduced since BYOB2, and they are roughly explained in this document.

Ha! That nested sprite feature is cool!


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#1284 2010-08-05 01:05:43

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

Re: BYOB 3 - Discussion Thread

Okay, here it is!
http://drop.io/scratchBYOB/asset/lineup-ypr
It's very simple, not too much going on, but I'm very proud of my bubblesort implementation!


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

Offline

 

#1285 2010-08-05 02:26:05

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

Re: BYOB 3 - Discussion Thread

sorting by awesomeness, I love it, thanks, fullmoon!


Jens Mönig

Offline

 

#1286 2010-08-05 02:28:26

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

Re: BYOB 3 - Discussion Thread

Whoops, I've been refering to lambda-gobo as "Alfonzo"! I'll change that!

EDIT: Eventually, that is.

Last edited by fullmoon (2010-08-05 08:25:07)


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

Offline

 

#1287 2010-08-05 05:58:01

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

2.995.008, this time for sure...

Jens wrote:

after a long night of debugging, optimizing and frenzied testing a follow-up to yesterday's "final beta", this release sweeps up a minor (but awfully hard to track down) bug in the list setter code that prevented Brian's "streams" project to run to completion in this week's previous beta releases. Turns out fixing this bug and tweaking a few other things also and again speeds up some list operations, so now "streams" and "ttt" /does/ run a little faster again.

The last release of the beta? Am I reading this right?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#1288 2010-08-05 07:26:46

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

Re: BYOB 3 - Discussion Thread

markyparky56 wrote:

bharvey wrote:

2.995.008, this time for sure...

The last release of the beta? Am I reading this right?

Yup, that's right. Preparing the full release now...


Jens Mönig

Offline

 

#1289 2010-08-05 07:44:34

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Jens wrote:

markyparky56 wrote:

bharvey wrote:

2.995.008, this time for sure...

The last release of the beta? Am I reading this right?

Yup, that's right. Preparing the full release now...

That's what you said last time  tongue


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#1290 2010-08-05 12:12:48

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

Re: BYOB 3 - Discussion Thread

I think there should be an (argument # () of [a block]) block in the BYOB3 final.


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

Offline

 

#1291 2010-08-05 12:38:34

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

Re: BYOB 3 - Discussion Thread

I found a bug:
When you try to delete a section of a custom block's title text, it gives you an error. And after that error, you can't edit the block anymore.


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

Offline

 

#1292 2010-08-05 12:48:39

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

Re: BYOB 3 - Discussion Thread

thanks, rubiks_cube_guy238!
I fixed that bug for the final release.


Jens Mönig

Offline

 

#1293 2010-08-05 13:04:08

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

Re: BYOB 3 - Discussion Thread

Another glitch: if you do something like

say (call(the script[say [Hello!] ]) )

then the sprite would say 'Hello!' forever. It does this as long as there isn't a [report[]] block inside the script.
Also, the (the script[]) block inside the (call()) block can't have the grey outline.

Another glitch (it's amazing how many glitches you always find right before the deadline, isn't it? :) )

If you set a variable to a script, and if that script has a [report[]] block in it, when you do <is (that variable) a [command/reporter/predicate]> it will result in false.

Last edited by rubiks_cube_guy238 (2010-08-05 13:16:00)


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

Offline

 

#1294 2010-08-05 16:35:17

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

Re: BYOB 3 - Discussion Thread

ScratchReallyROCKS wrote:

That's what you said last time

People do keep reporting bugs, but we're at the point where it doesn't pay to release daily image files; we have to start putting complete packages together!  I don't think it'll pay for us to call the next release 2.995.009, for better or for worse it'll be 3.0 unless Jens discovers that half the code has to be rewritten or something, in which case we'll just shoot ourselves.  sad


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

Offline

 

#1295 2010-08-05 16:36:37

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

Re: BYOB 3 - Discussion Thread

rubiks_cube_guy238 wrote:

I think there should be an (argument # () of [a block]) block in the BYOB3 final.

Way too late for 3.0 feature proposals!  Maybe 3.1 or something.


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

Offline

 

#1296 2010-08-05 17:36:23

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

Re: BYOB 3 - Discussion Thread

rubiks_cube_guy238 wrote:

Another glitch: if you do something like

say (call(the script[say [Hello!] ]) )

then the sprite would say 'Hello!' forever. It does this as long as there isn't a [report[]] block inside the script.

Correct, reporters ought to report something.  smile 
But you can stop it by pressing the red stop button.

rubiks_cube_guy238 wrote:

Also, the THE SCRIPT block inside the CALL block can't have the grey outline.

Yes it can for me.

rubiks_cube_guy238 wrote:

If you set a variable to a script, and if that script has a [report[]] block in it, when you do <is (that variable) a [command/reporter/predicate]> it will result in false.

When I do this it answers "true" when asked if it is a reporter, which it is.

Last edited by Jens (2010-08-05 17:37:08)


Jens Mönig

Offline

 

#1297 2010-08-05 18:23:35

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

I think you have the wrong solution.  You are asking BYOB programmers to think at a very low level of abstraction.  What we need (Jens, on the 3.n list) is downvars, which are like upvars only backwards.

I would not call pointers a "very low level of abstraction"...

It would be a simple, yet extremely powerful addition to BYOB.

bharvey wrote:

It would be simple enough to implement, but to use it would take an intellectual leap that I think is about as high as the one for first class functions, or at least the one for recursive functions, and with much less payoff.

Much less payoff? It's an important programming concept and you want to ignore it?!

Jens wrote:

bharvey wrote:

nXIII wrote:

You can't pass variables to be changed within a block.

Ah, here you are pointing (sorry) to a real problem

But yes, you can pass a LIST to be changed within a block!

Which shouldn't be.
Why would you want to pass variables by value and lists by reference? It's inconsistent, and I think BYOB programmers should learn that they need to pass by reference to change an object sent.

Last edited by nXIII (2010-08-05 18:25:16)


nXIII

Offline

 

#1298 2010-08-05 18:56:06

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

Re: BYOB 3 - Discussion Thread

Naw, pointers are a powerful idea, but only if they are invisible to the user and programmers don't have to think about them.  smile
Once you start fidgeting around with pointers you're basically the only one who'll be able to understand your code.

Hey, you can assign a list to a variable, and then pass the variable to a custom block and make it change the list. That's the whole idea of first-class-ness. You could do it to procedures, too, if we're going to add such primitives like CHANGE CATEGORY TO: _

However, I consider it good (non-destructive) programming style to almost always work with (shallow) copies and functions, or to only allow objects to change themselves, not outside entities. It's one of the ideas behind what they call encapsulation, and it totally rocks if you're building big, complex systems that need to scale.


Jens Mönig

Offline

 

#1299 2010-08-05 22:32:39

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

Re: BYOB 3 - Discussion Thread

Wow! Almost to the finally release!!! w00t!


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

Offline

 

#1300 2010-08-05 23:38:21

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

Re: BYOB 3 - Discussion Thread

Uh-oh! I have a video bug report for you here: http://www.screentoaster.com/watch/stUE … 1aXl1RXlVW

Sorry about the mic quality!


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

Offline

 

Board footer