Nick Smith
Nick Smith
Understood! I'm just saying that if you reorder the arguments of moveinit (making it into `__move__`), then it would be easier to explain to learners what's happening. (Because the variable...
Hmm... what if the trait was itself named `__len__`? And we could have an `__int__` trait etc. One for every dunder method.
@melodyogonna We could actually use the keyword `static` to declare static methods as well. This is the syntax that every other programming language (including C++) uses. We can still support...
> `static` has a very different meaning in C and C++ In struct definitions and function bodies—which are the two examples I gave—the proposed meaning of `static` is the same...
Following a discussion on Discord (`#mojo`), I'd like to also acknowledge that: - The semantics of `static` that I proposed is closer to the semantics of `static const` in other...
In [another issue](https://github.com/modular/modular/issues/4565), somebody proposed introducing the keyword `static` with a similar meaning to that of C++. I disagreed with this suggestion. I posted a few thoughts starting [here](https://github.com/modular/modular/issues/4565#issuecomment-2907617410). These...
> I'd also like to see `destroy foo` be a shorthand for `foo.__del__()` for types with a destructor I disagree with this. As I understand it, `destroy self` is meant...
> I don't think doing it with traits will be doable until we have reflection, unless it's pure compiler magic. That's exactly what I'm suggesting: the traits `Copyable`, `Movable`, `Droppable`,...
> I think Value should be a composite of Copyable + Movable + Droppable, nothing more. +1. This is simple, and consistent with how the `@value` decorator currently works in...
Yeah, IMO the [resyntaxing thread](https://github.com/modularml/mojo/issues/3623) is a big lesson on "don't try to finalize the syntax of something until you've figured out all of the places it will be used...