WurstScript icon indicating copy to clipboard operation
WurstScript copied to clipboard

Add inline closure declarations

Open Frotty opened this issue 7 years ago • 0 comments

Instead of having to make an interface or abstract class, just allow specifying the input and output type to get a functional type. So instead of this:

interface MyClosure1
    function run(real r) returns int
interface MyClosure2
    function run() returns int

function foo1(MyClosure1 clsr)
function foo2(MyClosure2 clsr)

This

function foo1((real -> int) clsr)
function foo2((nothing -> int) clsr)

Frotty avatar Mar 28 '18 16:03 Frotty