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

#3001 2011-03-04 22:40:20

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

Re: BYOB 3 - Discussion Thread

OMG My conference is this coming week! Somehow I convinced myself it was the week after.  I don't think we'll have the final 3.1 ready after all.  sad   Oh well, we can use 3.0 for the workshop and give them a sneak preview of 3.1 alpha.

P.S. Have a good vacation, Shadow!  smile


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

Offline

 

#3002 2011-03-05 01:07:52

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

Re: BYOB 3 - Discussion Thread

Thanks! I'm having fun, but I'm still pretty disappointed I don't get to go to the conference.  sad

Too bad about 3.1. However, Jens is a miracle worker when it comes to meeting (and beating) deadlines, so who knows?  smile

Offline

 

#3003 2011-03-05 11:11:06

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

I want a closure which can be called with a variable number of arguments and which knows the amount of arguments it was called with. The solution: a list of the arguments. This is not the same thing as an argument which is a list, which could be checked with an IF statement at the beginning of the closure.

I'm sorry, I'm short on sleep, maybe I'm being dense, but I don't see the distinction you're making.  If the procedure can be called with a variable number of arguments, then either it has a variable number of formal parameters, which I can't envision at all, or else it has one formal parameter bound -- somehow -- to all the arguments.  The easiest "somehow" I can see is to make a list of the arguments.  You want to know how many there are?  Call LENGTH on the list!

Also, are you using "closure" and "procedure" to mean two different things?  I was brought up with the understanding that in a lexically scoped language a procedure is the closure of a lambda expression -- in other words, the procedure provides bindings for all the free variables in the lambda expression.

Sorry. I did mean formal parameters.
call (the script. Input names args [for each (args) [say ()]]) with inputs (list "foo "bar "baz)
vs.
call (the script [for each (inputs) [say ()]]) with inputs "foo "bar "baz

Last edited by nXIII (2011-03-05 11:12:29)


nXIII

Offline

 

#3004 2011-03-05 15:43:28

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

call (the script. Input names args [for each (args) [say ()]]) with inputs (list "foo "bar "baz)

Just use "with input list" instead of "with inputs"!


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

Offline

 

#3005 2011-03-05 16:34:25

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

call (the script. Input names args [for each (args) [say ()]]) with inputs (list "foo "bar "baz)

Just use "with input list" instead of "with inputs"!

That's not the same thing, though.


nXIII

Offline

 

#3006 2011-03-05 16:38:38

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

call (the script. Input names args [for each (args) [say ()]]) with inputs (list "foo "bar "baz)

Just use "with input list" instead of "with inputs"!

I think what nXIII wants is the complete opposite of "with inputs list": to have the option to accept a single formal parameter that is a list of all the arguments passed to it, or to have a dedicated (arguments) reporter that returns a list of the arguments passed to the function that is currently being evaluated.


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

Offline

 

#3007 2011-03-05 17:32:57

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

Re: BYOB 3 - Discussion Thread

fullmoon wrote:

bharvey wrote:

nXIII wrote:

call (the script. Input names args [for each (args) [say ()]]) with inputs (list "foo "bar "baz)

Just use "with input list" instead of "with inputs"!

I think what nXIII wants is the complete opposite of "with inputs list": to have the option to accept a single formal parameter that is a list of all the arguments passed to it, or to have a dedicated (arguments) reporter that returns a list of the arguments passed to the function that is currently being evaluated.

The latter.


nXIII

Offline

 

#3008 2011-03-05 20:53:27

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

fullmoon wrote:

or to have a dedicated (arguments) reporter that returns a list of the arguments passed to the function that is currently being evaluated.

The latter.

Then just use the multiple inputs option in the long input dialog!

I am so not getting what you two want that we don't already have.  sad


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

Offline

 

#3009 2011-03-06 01:40:10

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

fullmoon wrote:

or to have a dedicated (arguments) reporter that returns a list of the arguments passed to the function that is currently being evaluated.

The latter.

Then just use the multiple inputs option in the long input dialog!

I am so not getting what you two want that we don't already have.  sad

I totally forgot about that feature...I was thinking in terms of THE SCRIPT, which doesn't share this capability. IMO the block editor provides this well enough that it shouldn't be an issue that you can't do it with anonymous functions.


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

Offline

 

#3010 2011-03-06 01:46:13

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

Re: BYOB 3 - Discussion Thread

fullmoon wrote:

I totally forgot about that feature...I was thinking in terms of THE SCRIPT, which doesn't share this capability.

Which is why, long ago, at the dawn of time, my first comment on this topic was

bharvey wrote:

IMHO what you really want is the ability to right-click an input name orange blob and have a "set type" option that opens the same dialog as the long form Block Editor input name/type one.  Then you could just choose the multiple inputs option.

tongue

EDIT: Wouldn't it be cool if, when you drag a typed-input lambda into a RUN or CALL block, it automatically gave you a WITH INPUTS with the right input slot shapes?

Last edited by bharvey (2011-03-06 01:54:37)


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

Offline

 

#3011 2011-03-06 03:57:21

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

EDIT: Wouldn't it be cool if, when you drag a typed-input lambda into a RUN or CALL block, it automatically gave you a WITH INPUTS with the right input slot shapes?

Whoa, now we're talking. You know, we could actually do this!


Jens Mönig

Offline

 

#3012 2011-03-06 13:19:19

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

Whoa, now we're talking. You know, we could actually do this!

Don't get too excited.  Although very cool, it'd rarely be really useful, because when you drag an explicit lambda into a RUN or CALL it's because you're going to use an argument to the enclosing procedure as the argument to the RUN/CALL.

But the first half, the part about giving anonymous procedures access to the long form input dialog, is useful.


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

Offline

 

#3013 2011-03-06 15:13:48

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

fullmoon wrote:

or to have a dedicated (arguments) reporter that returns a list of the arguments passed to the function that is currently being evaluated.

The latter.

Then just use the multiple inputs option in the long input dialog!

I am so not getting what you two want that we don't already have.  sad

That is a single formal parameter which accepts a list. I want a local variable which contains a list of the arguments the function was called with.


nXIII

Offline

 

#3014 2011-03-06 23:14:09

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

Re: BYOB 3 - Discussion Thread

nXIII wrote:

That is a single formal parameter which accepts a list. I want a local variable which contains a list of the arguments the function was called with.

It's a formal parameter bound to a list of all the arguments the function was called with.  I don't see the difference.

Is it that you want also to have individual formal parameters for the individual arguments?  If so, just set a variable to (LIST arg1 arg2 ... argn).  But it sounds like you want a variadic function, and that's what "multiple inputs" gives you!


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

Offline

 

#3015 2011-03-07 06:13:24

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: BYOB 3 - Discussion Thread

bharvey wrote:

nXIII wrote:

That is a single formal parameter which accepts a list. I want a local variable which contains a list of the arguments the function was called with.

It's a formal parameter bound to a list of all the arguments the function was called with.  I don't see the difference.

Is it that you want also to have individual formal parameters for the individual arguments?  If so, just set a variable to (LIST arg1 arg2 ... argn).  But it sounds like you want a variadic function, and that's what "multiple inputs" gives you!

I think what is wanted is the insert is a list. Probably do THE BLOCK with the list inside, and CALL it in the block. That right?  hmm

Offline

 

#3016 2011-03-08 20:55:54

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

Re: BYOB 3 - Discussion Thread

Hi from Dallas!  Here's today's 3.1 alpha release:

Jens wrote:

Tonight's build tries to improve navigation among sprites' children in the sprite corral (the area beneath the staged that's called "sprite library" in Scratch):

Right clicking on the stage icon pops up a menu with all non-cloned sprites in the project. Selecting one of these both selects it in the corral and pops up another menu with all of its children, if any. Clicking anywhere else (not on a menu item) just closes the menu.

Right clicking an a sprite icon in the corral now also gives you the same "children..." option (but only if the target sprite in fact has children) that you get when selecting a sprite from the stage icon's context menu in the corral.

Enjoy!
--Jens


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

Offline

 

#3017 2011-03-09 12:02:54

ahmedb
Scratcher
Registered: 2011-03-08
Posts: 54

Re: BYOB 3 - Discussion Thread

can anyone make a block in which you can read or a write a file (.txt)

Offline

 

#3018 2011-03-09 14:06:41

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

Re: BYOB 3 - Discussion Thread

ahmedb wrote:

can anyone make a block in which you can read or a write a file (.txt)

Someone would have to mess with the elements editor 4 that...


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

Offline

 

#3019 2011-03-09 23:06:35

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

Re: BYOB 3 - Discussion Thread

Today's alpha release and breakout.ypr:

Jens wrote:

Tonight's build speeds up yesterday's navigation feature. It also
significantly speeds up deleting objects through the DELETE block.

I'm attaching an updated version of the breakout.ypr example which now
actually deletes broken bricks rather than just hiding them. I also
revamped the example by throwing in a dose of dynamic value inheritance
imitating a class variable.

Enjoy!
--Jens


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

Offline

 

#3020 2011-03-10 13:45:29

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Today's alpha release and breakout.ypr:

Wow, Jens just keeps delivering  smile

Last edited by 14God (2011-03-10 13:45:55)


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

Offline

 

#3021 2011-03-12 14:55:16

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

Re: BYOB 3 - Discussion Thread

I'm so frustrated! I've been wanting to run the latest BYOB dev releases, but I kind of limited in the fact that I'm now running Ubuntu. Windows was giving me huge problems, so I wiped the computer, intending to reinstall 7. Unfortunately, the installer wouldn't work. So I got stuck with Ubuntu (not that it's all THAT bad).

I'm running the 64-bit version, however. And that means an alternate Scratch version which means NO Scratch image to replace!

Oh well.  hmm

Offline

 

#3022 2011-03-12 16:58:24

Taneb
Scratcher
Registered: 2009-07-07
Posts: 100+

Re: BYOB 3 - Discussion Thread

If you go to the Add/Remove Software thing and search for Squeak, you can use that to open the image.

Offline

 

#3023 2011-03-12 17:27:41

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: BYOB 3 - Discussion Thread

I like the new object insert!


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#3024 2011-03-12 21:17:03

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

Re: BYOB 3 - Discussion Thread

Taneb wrote:

If you go to the Add/Remove Software thing and search for Squeak, you can use that to open the image.

Works like a charm. Thanks!

EDIT: Except presentation mode doesn't work.  hmm

Last edited by shadow_7283 (2011-03-12 21:24:39)

Offline

 

#3025 2011-03-13 06:10:07

Taneb
Scratcher
Registered: 2009-07-07
Posts: 100+

Re: BYOB 3 - Discussion Thread

I don't think that works at all on Ubuntu.

Offline

 

Board footer