Replies: 2 comments 3 replies
-
There are alternative ways to address the same thing, e.g. check out how extensions work in Swift. We'll need to look at this whole area as traits come in. |
Beta Was this translation helpful? Give feedback.
-
We don't have a goal of providing the Julia multimethod dispatch thing. There isn't an efficient way to implement that other than full monomorphization, it is better to express the same thing with generics, which we haven't designed yet. Let's build out the traits system and see what the limitations are. Just to be clear, I'm closing this right now just because it is too early to track this, not because it is necessarily a bad idea, thanks! |
Beta Was this translation helpful? Give feedback.
-
regarding this example:
I was told it's not possible to overload struct or class methods from free floating functions? In julia (sorry for bringing Julia up again, but it's my reference for understanding these sorts of features) it's really nice to be able to register new functions for a type without subclassing or monkeypatching. For example, in this case I might like to define a
getitem
but perhaps for a custom range type in a third party package without a trait subtypeThis type of things is key to Julia's modularity and code reuse. Can it be considered for mojo?
Beta Was this translation helpful? Give feedback.
All reactions