Discuss Scratch
- Discussion Forums
- » Suggestions
- » New block
- theonlygusti
-
1000+ posts
New block
With the addition of just one, simple block, Scratch would become so much more powerful:
New Block
This block creates and reports lists,

This block would enable lists to become first class data-types.
A first class data-type can be:
So, lists would become much more powerful: you could create 2-dimensional, 3, 4, 5-dimensional arrays easily

and much more.
TL;DR
Basically, this block allows you to create a list.
Previously, in Scratch you'd have to create a list (using the “Make a List” button), name it and then run something like:
But with this block you can create exactly the same list without having to name it, add items to it, etc.
They both produce the same list!
Usage
Because they are first-class data structures now, they can be assigned to variables:
The above code would draw an (almost) equilateral triangle between the vertices (-30, 0), (30, 0) and (0, 51.96). These vertices were able to be stored as (x, y) lists within a variable.
You would also be able to pass the lists as arguments to a function:
The above code would give short lines of a longer monologue is a sequential order.
Now, don't bash these examples directly, as they were chosen simply to demonstrate how this block is used, not its actual uses. The uses of this block would extend far beyond simply telling stories.
New Block
(list [] ◀ ▶ :: list)
This block creates and reports lists,

This block would enable lists to become first class data-types.
A first class data-type can be:
- the value of a variable
- an input to a procedure/function
- the return value of a procedure/function
- anonymous (not named)
So, lists would become much more powerful: you could create 2-dimensional, 3, 4, 5-dimensional arrays easily

and much more.
————————————————————————————————————————
TL;DR
Basically, this block allows you to create a list.
Previously, in Scratch you'd have to create a list (using the “Make a List” button), name it and then run something like:
add [first] to [list v]
add [second] to [list v]
add [third] to [list v]
But with this block you can create exactly the same list without having to name it, add items to it, etc.
(list [first] [second] [third] ◀ ▶ :: list) // first, second, third
They both produce the same list!
————————————————————————————————————————
Usage
Because they are first-class data structures now, they can be assigned to variables:
set [triangle v] to (list (list [-30] [0] ◀ ▶ :: list) (list [30] [0] ◀ ▶ :: list) (list [0] [51.96] ◀ ▶ :: list) ◀ ▶ :: list)
go to x: (item (1 v) of (item (1 v) of (triangle))) y: (item (2 v) of (item (1 v) of (triangle)))
pen down
go to x: (item (1 v) of (item (2 v) of (triangle))) y: (item (2 v) of (item (2 v) of (triangle)))
go to x: (item (1 v) of (item (3 v) of (triangle))) y: (item (2 v) of (item (3 v) of (triangle)))
go to x: (item (1 v) of (item (1 v) of (triangle))) y: (item (2 v) of (item (1 v) of (triangle)))
pen up
The above code would draw an (almost) equilateral triangle between the vertices (-30, 0), (30, 0) and (0, 51.96). These vertices were able to be stored as (x, y) lists within a variable.
You would also be able to pass the lists as arguments to a function:
define tell story (lines)
set [current line v] to (1)
repeat (length of (lines) :: list)
say (item (current line) of (lines)) for [2] secs
change [current line v] by (1)
end
tell story (list [I am HAB, your Help & Advice Bot!] [You have to find the button to get out,] [move with the WASD keys. Try it now!] ◀ ▶ :: list)
The above code would give short lines of a longer monologue is a sequential order.
Now, don't bash these examples directly, as they were chosen simply to demonstrate how this block is used, not its actual uses. The uses of this block would extend far beyond simply telling stories.
Last edited by theonlygusti (May 5, 2016 15:47:36)
- theonlygusti
-
1000+ posts
New block
Also, it will allow for possible future blocks like python's for loop:
foreach ((c) :: control) in (range (0) to (10) :: custom) :: control cstart
say (c) for (0.5) secs
end
- Scratchifier
-
1000+ posts
New block
I don't quite understand this block. Perhaps you could add a more detailed explanation for people who haven't taken another programming language outside of Scratch?
Like, I'm learning C#, but I'm not there yet, so I don't really know what you're suggesting.
Like, I'm learning C#, but I'm not there yet, so I don't really know what you're suggesting.
- comp09
-
1000+ posts
New block
This block would make lists first class data types, like Snap! I don't quite understand this block. Perhaps you could add a more detailed explanation for people who haven't taken another programming language outside of Scratch?
Like, I'm learning C#, but I'm not there yet, so I don't really know what you're suggesting.
That means we can have lists inside lists inside lists…
- theonlygusti
-
1000+ posts
New block
Inside variables inside procedures inside lists…This block would make lists first class data types, like Snap! I don't quite understand this block. Perhaps you could add a more detailed explanation for people who haven't taken another programming language outside of Scratch?
Like, I'm learning C#, but I'm not there yet, so I don't really know what you're suggesting.
That means we can have lists inside lists inside lists…
- Tropic
-
1000+ posts
New block
Actually, I made a custom block (containing some hacked blocks) that can create a list, but it can't create multidimensional lists so this might still be useful 

- CatsUnited
-
1000+ posts
New block
I find it really confusing, especially that this is already in Snap and I have no idea how to use it.
- theonlygusti
-
1000+ posts
New block
Really? In snap you use it like: I find it really confusing, especially that this is already in Snap and I have no idea how to use it.
map ((() x (10) :: operators) :: grey ring) over (list [1] [2] :: list) :: list reporter
It just replaces regular lists.
- Iditaroid
-
500+ posts
New block
I love what this block adds but at the same time it was confusing to figure out at first when i saw it in Snap and i don't think it would be a great addition to Scratch!
- Deerleg
-
1000+ posts
New block
No support.
For one, beginners would not understand the purpose of this block.
And couldn't you just do this with a couple lists?
1. Empty three pre-made lists
2. Put stuff in them with the “add stuff” block
3. Go through each list with a loop of some sort and add each thing in the lists to another list
4. Done!
And
For one, beginners would not understand the purpose of this block.
And couldn't you just do this with a couple lists?
1. Empty three pre-made lists
2. Put stuff in them with the “add stuff” block
3. Go through each list with a loop of some sort and add each thing in the lists to another list
4. Done!
And
add (stuff) to [ list v]Not sure how it would work with functions but it should be possible.
- CatsUnited
-
1000+ posts
New block
Okay, but make sure you can still create scratch lists! Support.Really? In snap you use it like: I find it really confusing, especially that this is already in Snap and I have no idea how to use it.map ((() x (10) :: operators) :: grey ring) over (list [1] [2] :: list) :: list reporter
It just replaces regular lists.
- theonlygusti
-
1000+ posts
New block
No. No support.
For one, beginners would not understand the purpose of this block.
And couldn't you just do this with a couple lists?
1. Empty three pre-made lists
2. Put stuff in them with the “add stuff” block
3. Go through each list with a loop of some sort and add each thing in the lists to another list
4. Done!
Andadd (stuff) to [ list v]Not sure how it would work with functions but it should be possible.
The point of this is to have first-class lists, not more lists than needed.
Your suggested method doesn't create multidimensional lists, just four named lists, three of which are redundant, and one of which is pointless.
- CatsUnited
-
1000+ posts
New block
I think that making lists first class may be too expensive for new scratchers, so we end up staying in business or economy classNo. No support.
For one, beginners would not understand the purpose of this block.
And couldn't you just do this with a couple lists?
1. Empty three pre-made lists
2. Put stuff in them with the “add stuff” block
3. Go through each list with a loop of some sort and add each thing in the lists to another list
4. Done!
Andadd (stuff) to [ list v]Not sure how it would work with functions but it should be possible.
The point of this is to have first-class lists, not more lists than needed.
Your suggested method doesn't create multidimensional lists, just four named lists, three of which are redundant, and one of which is pointless.

Anyway, I still support, let's have some of the most luxurious seats on the plane!
- Deerleg
-
1000+ posts
New block
Well, at least my first point is right.No. No support.
For one, beginners would not understand the purpose of this block.
And couldn't you just do this with a couple lists?
1. Empty three pre-made lists
2. Put stuff in them with the “add stuff” block
3. Go through each list with a loop of some sort and add each thing in the lists to another list
4. Done!
Andadd (stuff) to [ list v]Not sure how it would work with functions but it should be possible.
The point of this is to have first-class lists, not more lists than needed.
Your suggested method doesn't create multidimensional lists, just four named lists, three of which are redundant, and one of which is pointless.
No support anyway.
- Discussion Forums
- » Suggestions
-
» New block