Passing a block to a method for it to use for sorting

Yeah, the first error is mismatched braces. You need to replace [ with { or } with ] to get a tuple literal or array literal, respectively. The former is probably better because it doesn’t allocate on the heap.

Then you need to specify if you want the sorter to be an inlined block or a (captured) proc. There’s a chapter Blocks and Procs in the language reference explaining these concepts and the differences. See also my recent post in Block forwarding and signature inference