jkbbwr
01/28/2018, 2:43 AMbenleggiero
01/28/2018, 5:54 AM#define
. I call these “preprocessor directives”)?
I approve of Swift’s use of a very minimal and strict set of these, mainly just for querying the targeted platform.
Further reading: https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/doc/uid/TP40014097-CH33-ID539
I’d be all for using this approach in Kotlin. Perhaps something like
#if platform(JVM)
...
#elseif platform(native.Windows)
...
#elseif platform(native.macOS)
...
#elseif platform(native)
...
#elseif platform(JS)
...
#else
...
#endif
and
#if kotlin(>=1.1)
...
#else
...
#endif
gildor
01/28/2018, 10:02 AMjkbbwr
02/01/2018, 11:09 AMgildor
02/01/2018, 11:16 AMjkbbwr
02/01/2018, 11:17 AMgildor
02/01/2018, 11:18 AMjkbbwr
02/01/2018, 11:20 AMgildor
02/01/2018, 11:22 AMgildor
02/01/2018, 11:22 AMgildor
02/01/2018, 11:22 AMjkbbwr
02/01/2018, 11:23 AMgildor
02/01/2018, 11:23 AMjkbbwr
02/01/2018, 11:24 AMjkbbwr
02/01/2018, 11:24 AMgildor
02/01/2018, 11:24 AMgildor
02/01/2018, 11:25 AMimplement unsigned numeric types as value types (represented as signed numbers under the hood)And Inline classes is the feature that allows to do that
jkbbwr
02/01/2018, 11:27 AMgildor
02/01/2018, 1:30 PMjkbbwr
02/01/2018, 3:40 PM