Nick Smith
Nick Smith
> What can we do to make working with String less painful concerning the null terminator? Whether or not `String` null-terminates its character buffer should be an implementation detail. If...
**TL;DR: I think the term "deterministic" more accurately reflects the concept that the React docs are talking about.** A deterministic function is a function that "always produces the same output...
> I'm not sure how [materialization of globals] generalizes to aliases in structs, because unlike globals there is no storage we can use to hold the value. Is it not...
@martinvuyk All of your examples include a `return` statement. With the proposed `init` convention, the idea would be that `return` is just _sugar_ for initializing the result. So the following:...
I don't think so. For the following example: ``` fn foo() -> (init output: Int): output = 4 ``` The idea is that `output` _is_ an argument. The only special...
@Mogball I'll share some of my thoughts on the design of this feature. > The only nuance here is that init != out. Because you can fieldwise initialize an init...
The keywords `construct` and `destruct` would lead to a very simple definition for "constructors" and "destructors" in Mojo: - A constructor is any function that uses the `construct` convention. -...
I think you're getting a few things mixed up. Firstly, while Python classes have both `__new__` and `__init__`, these methods aren't "argument conventions", they're just ordinary methods that are responsible...
Before we bother repainting the keywords for "references", I would like to publish my bombshell proposal to completely replace lifetimes with something else. 😇
@lattner How is your proposed syntax supposed to relate to the syntax for _calling_ `f`? As another example, if I have a function `fn g(out x: T, y: T)`, do...