Is there any way to make blocks that are somewhat like for-loops combined with functions: they can be placed in-line with other blocks (like for-loops) and can have parameter values that can be used (like functions). I’d something somewhat like Python’s
with statement, that allow variables to be used in a certain context. After looking at https://makecode.com/playground I haven’t seen a way to create for-loop-like blocks.
Some background: I want an easy way to allow someone to access all the fields of an object. Currently I’m working on an object based approach that requires “getting” an instance and then passing it to different getter-style methods to extract instance variables. I’d really like a single clamp-style block that gets the object and provides access to a consistent set of all instance variables. (I’m also open to suggestions for other approaches)