Which do you think is better, my Create Block from or the new define block?


or the new block?

I'say the vanilla snap way of programatically creating custom blocks is better, as it does not use javascript. Of course since I'm on a phone right now, I can't really test it out.

Also, when using javascript in snap, NEVER use join to put inputs into javascript. Use javascript variables like this

Edit: now that I'm on my ipad, I can test it, and I still say the vanilla way is better. It does not use javascript, and it is just a lot more compatible. Plus, you can stor the new block in a variable, allowing you to use it later. You can also create a block that can create blocks, pretty much just like you block, but with no js.

Okay. But there are many things that use js, and also you can choose the category with mine. But its nice to finally hear someone's opinion!

You can choose the category with the vanilla Snap! blocks too.

At one time we talked about a DEFINE block with a zillion inputs for type, category, etc. But the thing is, you also want to provide type info for all the input slots. Jens decided that putting all that in the one DEFINE block would make it too hard to use, and so he opted for a simple DEFINE and then using the SET _ OF BLOCK block to control the details, with reasonable defaults. I had argued for extending the way you can put "square %size" in the text field of the Make A Block dialog so you'd be able to say something like "%sixe:#=100" to say it's a numeric slot with default value 100, and use the same notation in a DEFINE block. But Jens points out that we can all use the existing metaprogramming blocks to define whatever interface we want.

I prefer the new block because you don't need JS for that.

so...? your answer?


I thought I did answer: You can build any user interface you want around the 8.0 metaprogramming feature.

The thing I really want, which Jens hates, is that you should be able to click on one of the formal parameters of the grey ring surrounding the body of the block you're defining and get the same long form input dialog you get when you click on a formal parameter in the Block Editor. But that would only be useful in the case where the user doesn't want to control the input type programmatically. But I expect that that'll be the most common case.

whats that?

whats metaprograming and how do i use it and how do i get to it?

Programs that manipulate programs. There's a whole new chapter in the Reference Manual about it.


how can i get to the manual?

Right-click on the Snap! logo in the corner of the editor and choose Reference Manual.

ok thx

You don't even have to right-click, you can left-click.

off topic but i just made a whole game rage quit

Oh right, sorry!

Personally, I like the define block primitive more, because it can be used for recursion and doesn't have lots of inputs.