Block XML Generator

Don't use the serializer. You don't want a text string, you want a list structure. Something like


as the translated version of
untitled script pic (1)
Don't put too much faith in the details; this is just off the top of my head and I'm probably forgetting some important information. All I really want you to take from this is the idea of a nested list structure, rather than a linear text. This is called the Abstract Syntax Tree of a program.

P.S. This nested structure is already in the script itself; all you have to do is make its pieces manipulable by the user. See https://people.eecs.berkeley.edu/~bh/v2ch5/prgdat.html for examples of what I want to be able to do.

Yes but I was trying to make it so someone could define blocks like this just to see if it was possible.
XML generation script pic(5)


Project link
Use turbo mode for the best performance
No JS is used at the moment

image Is this deliberate?

I have no idea what your EMPTY RING block does.

But I'll guess that what you're asking is whether the value of an empty ring should be an empty ring. We have arguments about this. Mostly I think it should be the identity function, so MAP with an empty first input would report a copy of its second input.

It's not mine

Oh I see, it's not a question about Snap! in general. Sorry...

Its a simple comparison. It doesnt use any Javascript blocks (which i think can use the empty ring property) so it just compares to the string version of rings. It's not used anywhere, was using it for the DO NOT USE version of the block xml generator to test if the user had placed any sort of block as input

Tried it out with some combinations like multiple colors and notes, works perfectly. Should totally be implemented.

is there a way to make custom hat blocks using something like this? also, how do I make a block that has a non multiple non readonly %kayHat menu?

I just figured it out

lol, what's this XML generation script pic

and this? XML generation script pic (1)

and this XML generation script pic (2)
and this? XML generation script pic (3)
and dis?

I LOVE THIS!!!!!!!!!!!!!!!!!!!!! (this is the last time I'm editing this post)

I dont know how a custom Hat would be created or exported so I didnt implement anything

We have it! That's what the generic hat block is.

what?

He's talking about the when <> block

yes, it is possible:
https://snap.berkeley.edu/snap/snap.html#present:Username=dms_64&ProjectName=block%20builder&editMode&noRun
(I also made it easier to build blocks)
It is the same except you put the "new custom block" block directly in the "Script : Build" block. And you can make multiple blocks at once!

cool! also, what is


Can I use this block to compile XML that I created?

yesop