Let's try Scratch for a bit during lunch break. I've touched some of the derivatives and old stuff, but after thinking about it, I realized that I don't know the latest version of the original.
I guess I can create an account here: https://scratch.mit.edu/
Make a list
Stack machines were built.
I recognized from an article on the net that you can define functions, but I wonder if you can only define procedures that do not return values...
abee2: User-defined blocks have arguments but no return value (that's why they are procedures, not functions). Built-in functions (rounded reporter blocks at both ends, pointed boolean blocks) have return values. It is said to be one of the seven wonders of Scratch that people have been pointing it out all along but it has never been introduced. Twitter
Messages can be sent and received, but messages don't seem to have arguments.
Can't you put whitespace in literals?
I've put the list in length of x. The same name but red block to get the length of the list.
String can now be parsed and added/subtracted, a subset of FORTH.
A function that returns a value can be realized by preparing a variable that holds the value.
We can do a roundabout way lol.
Since there is no local variable, it is not possible to "put the return value in another variable immediately after the function call", so I decided to put the return value on the stack and retrieve it when I need it.
I'm wondering if there is a way to make a block like a partial application of a function, since there is no local variable, or more precisely, "no new assignment can be made in the block" and the argument is a local variable.
I would also like to create as many lists of indefinite length as I want in my program, but there are two ways to do that: one is to make it a string, and the other is to create a linked list within a single list.
I wonder if the next assignment is "Given a string consisting of opening and closing brackets. Determine whether the parentheses correspond" and the next one is "Perform a calculation expressed as an S-expression"?
This page is auto-translated from /nishio/Scratch using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.