https://kotlinlang.org logo
#compose
Title
# compose
a

andylamax

08/01/2020, 12:43 PM
The compose compiler treats compose functions in much similar way the kotlin compiler does to suspend functions. Correct? My curiosity is, why did the Compose Dev team decide to go with annotations (i.e.
@Compose
) instead of making compose a reserved word, similar to suspend functions? Knowing this was much influenced by JB, if the annotations approach seemed more convenient, why didn't they go with it for suspend functions? (i.e
@Suspend
)
I was assuming the
compose
keyword could have been reserved for UI function in each platform
@Leland Richardson [G] @Zach Klippenstein (he/him) [MOD]
s

shikasd

08/01/2020, 12:55 PM
I think a big factor here is that Compose is compiler plugin with a separate runtime and not embedded into language Whereas suspend functions are processed by Kotlin itself on many levels
a

andylamax

08/01/2020, 1:09 PM
Thank you so much for your explanation
3 Views