Is it possible to make lambdas in makecode?

@Cybercube you can store things in variables for return values but since all variables in blocks are global it can get pretty tricky. very easy to accidentally overwrite your return value when something gets called recursively.

there is exactly one block that takes lamdas with a return value and it’s pause until, but it’s built-in to makecode (there’s no way to replicate its behavior in an extension).

the closest thing you can do is define blocks that take an anonymous function as alex mentioned. you could always make your own return block i guess, something like this:

but it’s pretty gross

2 Likes