Crystal Medium · Lesson 5

Procs, closures and captured blocks

Create procs with ->, capture variables in closures, turn methods into procs, store blocks with &block, and pass procs where a block is expected.

Lessons · Crystal Medium · Lesson 5 of 10

Procs, closures and captured blocks

Create procs with ->, capture variables in closures, turn methods into procs, store blocks with &block, and pass procs where a block is expected.

Illustration for Crystal
Create procs with ->, capture variables in closures, turn methods into procs, store blocks with &block, and pass procs where a block is expected.