Hacker News new | ask | show | jobs
by ngmc 2541 days ago
Scratch lists seem relatively first-class to me. Your son could probably have fun building simple data structures with them by making blocks that take an input. He can also update a "return" variable if the situation calls for it.

https://en.scratch-wiki.info/wiki/List

2 comments

Scratch lists are not first class. You can only create them as variables; you can't create list "values" (there are no list literals) and you can't pass lists around. You can only provide lists as arguments by choosing list variables from a dropdown of certain built-in blocks.
Yup, tried setting a 'return' variable. It's less than elegant of course, and there are potential concurrency issues.

Lists can't contain lists, nor can they be passed as inputs to blocks, unless you encode them as text or numbers.