Hacker News new | ask | show | jobs
by toontalk 2547 days ago
Scratch 3 does not enable one to define new functions only new commands. Snap! user-defined functions are first-class - they can be used to define higher-order functions.
1 comments

Here's the elegant Snap! visual Y Combinator:

https://imgur.com/cOq8tvR

Visual Lambda: Note how the gray block after the "report", shrink-wrapped around the "call (fn) with inputs (fn) []", is a visual "lambda". It looks like a "gasket" or "baggie" that insulates the code inside from being immediately evaluated, returning a closure instead.