Script builder library (Part 1)

Wait do you mean this?

Wait do you mean this?
untitled script pic

split ({}) by [block v]

is the library meant to be like, a joke? since it seems to not be useful

yes im lazy to type that

Well Brain thinks otherwise. And this was originally for a BASIC compiler project reverse codification thing.

Why would you want that?

cor?

how do you mispell cor as cor and not notice it?

oh i see now

Well here's what I came up with:

But for some reason it isn't working. I suspect that this might be because the (() to () from {}) block and the ({} put after {}) block modifies the original. I don't know how to fix this because I don't know how to make a copy of a block.

thanks

no

I don't understand. You can already put code in a variable without the use of a library. Blocks are first-class.

Hold on, I realized I made a mistake in the previous definition I gave. Here is the updated version:

Also, now I made it so the ({} put after {}), (() to () from {}), e.t.c. do not modify the given scripts/expressions and instead return a new one. So now this works. You are going to have to re-download the library.

should be misspell and

should be Brian.

I've been trying to make macros work, but it's kind of hard since I can't put a continuation as a block argument.

You're digging around the JS code. Can't you just use CALL W/CONTINUATION?

Yes, I did, and to prevent the actual continuation from running afterwards I put a stop this script block. But when you do that in a loop it will stop the entire loop and won't let the loop finish. There's no continue block and I don't want to always have to put a continue-able loop for it to work.

Also I was thinking to make inputs for the macros

Yeah, in the end we'll have to make macro generation part of the make-a-block dialog, with a checkbox or something for a macro. It's going to require some careful design, because, among other issues, there will be command macros, which are syntactically commands, so they click into a stack, but they report a value. So maybe you shouldn't try too hard.

Oh, wait, you said stop this script? Not stop this block? Try that.

What do You consider the crucial elements of a macro?
Runtime binding/access to variables?
With "create variables" library a kind of a macro can be built.
Variables can be manipulated with
SimpleMacro script pic (1)

and used with #inline
SimpleMacro script pic

"Macro" can use the already declared var or create a new one.
SimpleMacro script pic (4)

Example project: https://snap.berkeley.edu/snap/snap.html#present:Username=dardoro&ProjectName=SimpleMacro