Discuss Scratch
- Discussion Forums
- » Suggestions
- » First-class procedures and custom reporters
- kenny2scratch
-
500+ posts
First-class procedures and custom reporters
Omg why are you bumping this it’s basically accepted…
may lord have mercy on the necroposter’s souls
may lord have mercy on the necroposter’s souls
- Jonathan50
-
1000+ posts
First-class procedures and custom reporters
Did I miss something? I'm 90% percent sure it was never accepted 

- kenny2scratch
-
500+ posts
First-class procedures and custom reporters
It’s in Backlog on GitHub for 3.0 - I might have been mistaken if you meant add this to 2.0.
- Jonathan50
-
1000+ posts
First-class procedures and custom reporters
Oh, cool! I looked and I found custom reporters, but not first-class procedures. It’s in Backlog on GitHub for 3.0 - I might have been mistaken if you meant add this to 2.0.
- kenny2scratch
-
500+ posts
First-class procedures and custom reporters
Hmm. I don’t think that would really flow with how Scratch works - do people really get passing the function itself as an argument instead of the result of the function? (I barely do even though I have worked with Python for about 7 years.) We don’t have first-class lists either - because they don’t go well either.
So I guess custom reporters are accepted, and no support for first-class procedures.
So I guess custom reporters are accepted, and no support for first-class procedures.
- Blaze349
-
1000+ posts
First-class procedures and custom reporters
They aren't… Hmm. I don’t think that would really flow with how Scratch works - do people really get passing the function itself as an argument instead of the result of the function? (I barely do even though I have worked with Python for about 7 years.) We don’t have first-class lists either - because they don’t go well either.
So I guess custom reporters are accepted, and no support for first-class procedures.
- donotforgetmycode
-
1000+ posts
First-class procedures and custom reporters
Lambdas, functions and procedures are the same words written in different ways.
- Jonathan50
-
1000+ posts
First-class procedures and custom reporters
the same words written in different ways.No they aren't, they're different words and have different meanings Lambdas, functions and procedures are

- Randomness-TV
-
100+ posts
First-class procedures and custom reporters
My head just did WHAT?
No Support, too confusing
No Support, too confusing
- birdoftheday
-
500+ posts
First-class procedures and custom reporters
To a baby, walking is too confusing. But they soon learn it's something they cannot do without.
- rdococ
-
1000+ posts
First-class procedures and custom reporters
We should get rid of walking - crawling can already get us everywhere, why do we need to use To a baby, walking is too confusing. But they soon learn it's something they cannot do without. only 2 legs? /s
Anyway, back on topic, I think this would be clearer to the newer among us (I'd put it in [img] tags, but it said “Bad image URL”).
Then, to run it:
run stored script (var) :: custom
- birdoftheday
-
500+ posts
First-class procedures and custom reporters
Or you can remove “stored script” and also allow blocks to be put there without a variable (w/ rings)
I.e. What I mean is, that block you posted is a bit like if the add block were like this
In the sense that if you ever wanted to add any numbers you'd first have to assign them to variables and use the variables which is exactly what “first class” isn't.
A good way to think of first class blocks is like ring blocks. Imagine if “repeat” were defined like this
Using this idea you'd be able to do exactly that, along with hundreds of more possibilities.
I.e. What I mean is, that block you posted is a bit like if the add block were like this
([v1 v] + [v2 v] ::operators)
In the sense that if you ever wanted to add any numbers you'd first have to assign them to variables and use the variables which is exactly what “first class” isn't.
A good way to think of first class blocks is like ring blocks. Imagine if “repeat” were defined like this
define repeat (n) (script)
if <(n) = [0]> then
stop [this script v]
end
run (script) ::control
repeat ((n) - [1]) (script)
Using this idea you'd be able to do exactly that, along with hundreds of more possibilities.
Last edited by birdoftheday (Aug. 14, 2017 13:22:33)
- rdococ
-
1000+ posts
First-class procedures and custom reporters
Yeah, but I doubt that one that's too confusing to newer Scratchers will be implemented (I'm not exactly sure what you mean, actually, so correct me if you meant something else). Or you can remove “stored script” and also allow blocks to be put there without a variable (w/ rings)
A good compromise might be in the form of a “on-the-spot define” reporter, with parameters like the inputs in the define hat. Since newer Scratchers (at least the ones who could even benefit from this) already know what the “define” hat block is, I think we should introduce first-class functions similarly. An example can be found here.
Last edited by rdococ (Aug. 14, 2017 13:27:42)
- birdoftheday
-
500+ posts
First-class procedures and custom reporters
Edited my post aboveYeah, but I doubt that one that's too confusing to newer Scratchers will be implemented (I'm not exactly sure what you mean, actually, so correct me if you meant something else). Or you can remove “stored script” and also allow blocks to be put there without a variable (w/ rings)
A good compromise might be in the form of a “on-the-spot define” reporter, with parameters like the inputs in the define hat. Since newer Scratchers (at least the ones who could even benefit from this) already know what the “define” hat block is, I think we should introduce first-class functions similarly.
- rdococ
-
1000+ posts
First-class procedures and custom reporters
What's stopping you from putting the “stored script”/“on the spot define” into block inputs or running it directly? It's just a reporter; like the Snap! rings. Or you can remove “stored script” and also allow blocks to be put there without a variable (w/ rings)
I.e. What I mean is, that block you posted is a bit like if the add block were like this([v1 v] + [v2 v] ::operators)
In the sense that if you ever wanted to add any numbers you'd first have to assign them to variables and use the variables which is exactly what “first class” isn't.
A good way to think of first class blocks is like ring blocks. Imagine if “repeat” were defined like thisdefine repeat (n) (script)
if <(n) = [0]> then
stop [this script v]
end
run (script) ::control
repeat ((n) - [1]) (script)
Using this idea you'd be able to do exactly that, along with hundreds of more possibilities.
- birdoftheday
-
500+ posts
First-class procedures and custom reporters
If your proposed on the spot define block looks something like this
then it's exactly what I'm talking about. I just didn't see your post while making that last one.
(the block (((2) * (2)):: grey ring) ::operators
then it's exactly what I'm talking about. I just didn't see your post while making that last one.
- rdococ
-
1000+ posts
First-class procedures and custom reporters
Again, that's equivalent to placing a “report ((2) * (2))” block in a “stored script” block - when you call it, it'll still return 2*2=4. I don't see how my idea makes the functions any less first-class than the rings do. If your proposed on the spot define block looks something like this(the block (((2) * (2)):: grey ring) ::operators
then it's exactly what I'm talking about. I just didn't see your post while making that last one.
EDIT: I'm also operating under the assumption that Scratch 3.0 will have custom reporters - which this suggestion is partly about, anyway.
Last edited by rdococ (Aug. 14, 2017 13:40:01)
- birdoftheday
-
500+ posts
First-class procedures and custom reporters
So it's more like this, then?
(the block ({report ((2) * (2)) ::control}::grey ring)::operators reporter
Last edited by birdoftheday (Aug. 14, 2017 14:22:40)
- sathvikrias
-
500+ posts
First-class procedures and custom reporters
yes! HUGE BUMP So it's more like this, then?(the block ({report ((2) * (2)) ::control}::grey ring)::operators reporter
support, because it is not very complicated.
- minecraftprox101
-
500+ posts
First-class procedures and custom reporters
Hi there! It looks like this topic is a duplicate. Please continue the discussion in that topic, so it all stays in one place, rather than scattered across the forums. In the future, I recommend that you search for duplicates. Thanks!
Message generated with leahcimto's duplicate message generator
EDIT: This is Sort of a Duplicate.
Message generated with leahcimto's duplicate message generator
EDIT: This is Sort of a Duplicate.
Last edited by minecraftprox101 (March 23, 2021 13:40:58)
- Discussion Forums
- » Suggestions
-
» First-class procedures and custom reporters