Discuss Scratch

bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

Maybe when you have a community website thing like Scratch make a way to share block libraries without them all going into the menu?
Yeah, we should do that, but I think it's also good to have a catalog of officially blessed ones.

Although in the case of stretching costumes, I hope we get to where that's doable, at speed, in plain Snap!, not using JS. You're going to be able to say OF and get a 2D array of pixels, and you should be able to make a new bitmap, and so on. Otoh, the JS implementation has the advantage that someone else has already solved the problem of scaling by a non-integer factor.

Jonathan50
Scratcher
1000+ posts

Snap! user discussion

Are costumes going to be OOP objects that OF works on?

Not yet a Knight of the Mu Calculus.
bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

Are costumes going to be OOP objects that OF works on?
Yes. We're going to push as hard as we can on “everything first class.” For sure sprites. costumes, sounds, and colors in 4.1. Maybe things like windows? threads (imagine TELL some-thread [STOP ])? pens? DOM elements? menus? palettes?

Jonathan50
Scratcher
1000+ posts

Snap! user discussion

Will there be a way to define Snap! objects that you can use OF on using JS? That would be cool…

Not yet a Knight of the Mu Calculus.
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

bharvey wrote:

Jonathan50 wrote:

Are costumes going to be OOP objects that OF works on?
Yes. We're going to push as hard as we can on “everything first class.” For sure sprites. costumes, sounds, and colors in 4.1. Maybe things like windows? threads (imagine TELL some-thread [STOP ])? pens? DOM elements? menus? palettes?
Objects don't need to be OOP objects to be first class… But that would be great!

Not yet a Knight of the Mu Calculus.
bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

Objects don't need to be OOP objects to be first class… But that would be great!
True enough. Like procedures for example. But I think Jens is leaning toward using a general OOP mechanism for all new types.

Will there be a way to define Snap! objects that you can use OF on using JS? That would be cool…
We are desperately trying to get me and Jens in a room long enough to work out all these design details. (Yes, there's the Internet, but it's way more productive when we're in the same room.) I think the answer to your question has to be yes, doesn't it? Once you have access to JS, you can change anything in Snap!. But we're thinking about whether we can make this possible from Snap! itself. The general idea is that there will be an object called Object, and you can clone it, and then (here starts the vague part) set its ATTRIBUTES attribute, or something. And also set its PRINTFORM attribute so you invent an exact rational object and set its print form to JOIN (numerator) (/) (denominator). And that's what it'll look like in a speech balloon or a list item or whatever.

Jonathan50
Scratcher
1000+ posts

Snap! user discussion

I'm trying to make a (purely functional, the “set” method actually returns a new object) prototyping OOP system in Snap!, but I'm getting a strange “Error: a variable of name ‘arguments’ does not exist …” error message. Can anybody help? The project is here.

Not yet a Knight of the Mu Calculus.
bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

Can anybody help?
Mmmaybe?

Your block UPDATE NAMED LET BINDINGS has two inputs, one a list and the other variadic (so effectively also a list). They have to be the same length. But when it's called by the named let block, it is given only BINDINGS as input. I have no idea whether it'll result in that particular error message, but it'll for sure be some kind of error when you take ITEM (I) OF an empty list.

Edit: And also, the ASSOC VAR NEW in the CLONE block will never succeed because you're calling it on a newly made clone, which therefore has only clone, set, and parent in its alist. (I don't think it has to be a newly made clone, by the way. You could just use SELF.)

Last edited by bharvey (June 4, 2016 04:22:04)


Jonathan50
Scratcher
1000+ posts

Snap! user discussion

bharvey wrote:

Jonathan50 wrote:

Can anybody help?
Mmmaybe?

Your block UPDATE NAMED LET BINDINGS has two inputs, one a list and the other variadic (so effectively also a list). They have to be the same length. But when it's called by the named let block, it is given only BINDINGS as input. I have no idea whether it'll result in that particular error message, but it'll for sure be some kind of error when you take ITEM (I) OF an empty list.
I'm pretty sure the named let block works fine, and I'm not providing not enough arguments to LOOP anywhere. So I don't think that's the issue. But not providing enough arguments to LOOP does show the same error message:


I've tried to isolate the issue, and it seems to be the LET VAR BE IN block that makes the difference…

How strange…
EDIT: The last one still errors without the 1 +

Last edited by Jonathan50 (June 4, 2016 04:31:47)


Not yet a Knight of the Mu Calculus.
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

bharvey wrote:

Edit: And also, the ASSOC VAR NEW in the CLONE block will never succeed because you're calling it on a newly made clone, which therefore has only clone, set, and parent in its alist.
I put that there in case someone does want to change clone, set or parent for some reason. Do you think it's unnecessary?
(I don't think it has to be a newly made clone, by the way. You could just use SELF.)
Okay. (It'll still behave exactly the same as if it was a clone that way, but it will probably be more efficient.)

Last edited by Jonathan50 (June 4, 2016 04:29:58)


Not yet a Knight of the Mu Calculus.
joefarebrother
Scratcher
500+ posts

Snap! user discussion

Will you be able to define what happens when you SET an arbitrary procedure?


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
Jonathan50
Scratcher
1000+ posts

Snap! user discussion

joefarebrother wrote:

Will you be able to define what happens when you SET an arbitrary procedure?
? It will return a new object with that procedure.

Not yet a Knight of the Mu Calculus.
joefarebrother
Scratcher
500+ posts

Snap! user discussion

Jonathan50 wrote:

joefarebrother wrote:

Will you be able to define what happens when you SET an arbitrary procedure?
? It will return a new object with that procedure.
I meant in Snap! 4.1, addressed to Brian


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
joefarebrother
Scratcher
500+ posts

Snap! user discussion

bharvey wrote:

Jonathan50 wrote:

Objects don't need to be OOP objects to be first class… But that would be great!
True enough. Like procedures for example. But I think Jens is leaning toward using a general OOP mechanism for all new types.

Will there be a way to define Snap! objects that you can use OF on using JS? That would be cool…
We are desperately trying to get me and Jens in a room long enough to work out all these design details. (Yes, there's the Internet, but it's way more productive when we're in the same room.) I think the answer to your question has to be yes, doesn't it? Once you have access to JS, you can change anything in Snap!. But we're thinking about whether we can make this possible from Snap! itself. The general idea is that there will be an object called Object, and you can clone it, and then (here starts the vague part) set its ATTRIBUTES attribute, or something. And also set its PRINTFORM attribute so you invent an exact rational object and set its print form to JOIN (numerator) (/) (denominator). And that's what it'll look like in a speech balloon or a list item or whatever.
What about first class morphs, i.e. accessing morphic.js from within Snap!? Then if PRINTFORM returns a morph, that is what appears in speech bubbles and watchers. Only problem I can think of is what if the morph already exists in the world, would it have to be copied?


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
bharvey
Scratcher
1000+ posts

Snap! user discussion

joefarebrother wrote:

Will you be able to define what happens when you SET an arbitrary procedure?
Not sure I understand your question correctly but I'll answer what I think you mean. I think that using SET with lambdafied getters to set attributes was one of the less successful design features of 3.1; nobody understood it. So instead there'll be a SET MY command block with a pulldown, just like the MY reporter. So the issue you're raising doesn't arise.

bharvey
Scratcher
1000+ posts

Snap! user discussion

joefarebrother wrote:

What about first class morphs, i.e. accessing morphic.js from within Snap!?
Oh yes I'm sure Jens will love that idea!

Jonathan50
Scratcher
1000+ posts

Snap! user discussion

My LET block seems to work fine… Is it a bug with Snap!?

Not yet a Knight of the Mu Calculus.
bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

My LET block seems to work fine… Is it a bug with Snap!?
Oy. I'll look at your project again tomorrow but I don't have the energy today, sorry, Jonathan.

xly
Scratcher
100+ posts

Snap! user discussion

BookOwl wrote:

bharvey wrote:

joefarebrother wrote:

I made a little thing that outputs Sierpinski triangles as Ascii art: http://snap.berkeley.edu/snapsource/snap.html#present:Username=jfb1337&ProjectName=sierpinski%20ascii%20art
Nice!
Agreed!

bharvey wrote:

(Is there anywhere besides this thread to share Snap! projects?)
Real soon now…

My contribution to sharing “user-block” discussion with this project dedicated to different methods for using “clones” (powerful but tricky !)
http://snap.berkeley.edu/snapsource/dev/snap.html#present:Username=xleroy&ProjectName=130-clotest
User-blocks can be shared through “shared projects” subject that the proposed project is not spoiled by “pickers” !

Last edited by xly (June 5, 2016 10:29:53)

bharvey
Scratcher
1000+ posts

Snap! user discussion

@Jonathan: Okay, I spent all afternoon trying different slight modifications to your code and stepping through it (with the wonderful PAUSE ALL block). The only place I can see where you might get that particular error message is in calling a block with a variadic input, bringing me back to UPDATE NAMED LET BINDINGS, but I tried rewriting REPLACE without named let and it didn't help. I give up.

Powered by DjangoBB