iex
05/16/2019, 7:36 PMval closure = { (a: Int -> Int) ->
a * 2
}
louiscad
05/16/2019, 7:37 PMclosure
explicitly though, and the IDE can even do that for you with an intention (alt/option + enter)iex
05/16/2019, 7:38 PMlouiscad
05/16/2019, 7:38 PMShawn
05/16/2019, 7:39 PMval closure: (Int) -> Int = { a -> a * 2 }
is the closest you can get to what you’re asking for, I thinkelizarov
05/16/2019, 7:39 PMval closure = fun(a: Int): Int { ... }
streetsofboston
05/16/2019, 7:40 PMclosure
if you would provide it explicitly?streetsofboston
05/16/2019, 7:42 PMstreetsofboston
05/16/2019, 7:43 PMval closure = { a: Int -> (a + 5) as Number }
Is this what you try to accomplish?iex
05/16/2019, 7:46 PMiex
05/16/2019, 7:47 PMstreetsofboston
05/16/2019, 7:47 PMiex
05/16/2019, 7:47 PMiex
05/16/2019, 7:48 PMstreetsofboston
05/16/2019, 7:48 PMiex
05/16/2019, 7:49 PMiex
05/16/2019, 7:49 PMiex
05/16/2019, 7:53 PM