groostav
05/18/2020, 6:35 AM//usage:
Kernel32::SetEnvironmentVariable.invokeForSuccessOrThrowLastError("EMPOWER_LGO_TRACE", "TRUE")
The key here is that I wanted to convert from Win32's C-compatible GetLastError()
into java exceptions.
To get this I needed a good whack of boiler-plate. see attached kt.
Am I missing something? Would arrow let me do something more clever here? I think at its roots the kotlin type signatures for functions do not let me write a single type that captures different arity.
tl;dr anybody know how i can write the boiler-plate in KotlinExtensions.kt more compactly?