Ilya I. Lubenets
Explore posts from serversMModular
•Created by Ilya I. Lubenets on 3/17/2024 in #questions
Kotlin's extension function in Mojo?
Not so long ago, I've discovered that Kotlin have a possibility to extend already defined classes with a new function.
For example:
will return
[Hello, world!]
list. This feature is really useful, as it makes code really cleaner without overriding whole class.
I don't asking Modular team to implement it. I'm just curious what others think about that. Is Mojo needs that or static methods
is enough? I mean, we can use text.getWordsList()
is Kotlin and get_words_list(text)
in Mojo and Python. What is better for you?9 replies