ivellapillil
MModular
•Created by ivellapillil on 5/15/2024 in #community-showcase
Online book on Mojo
@Zbornak Thanks for your feedback! At the moment as you said, I am still focusing on content especially since Mojo is such a moving target. I suspect I would have to rewrite quite a bit of text as Mojo further changes... May be we can take a look at it again once the book is in a reasonably complete form?
Thanks for your offer!
45 replies
MModular
•Created by Ivo Balbaert on 1/7/2025 in #questions
Try finally when opening a file
Having not seen the full code, if you assign to the same variable a new value, the old memory location is destroyed ASAP. So the variable starts again with uninitiatialzed state.
13 replies
MModular
•Created by ivellapillil on 5/15/2024 in #community-showcase
Online book on Mojo
Thanks for the feedback. I did omit it as it was a bit advanced topic. I think mentioning it briefly would help. I will take this feedback for the next release..
45 replies
MModular
•Created by ivellapillil on 5/15/2024 in #community-showcase
Online book on Mojo
Now some concepts on memory has been added.
https://ruhati.net/mojo/_memory_management_and_pointers.html
Please take a look. If you see any mistakes, would be glad if pointed out.
45 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
But most developers would not have to worry.
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
Yes. Most likely
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
Or some kind of a preprocessor like:
But then we need to be super carefull that the different reference types interoporate seamlessly.
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
So being a Reference is a "trait" as you suggest, but there is a default implementation used by the compiler when we use
ref
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
We can have that, and have a "default" referencepointer which is blessed with a syntax... The default one would be enough for 95% of cases...
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
I am not a PL expert - but could
ref
and the others be just syntax sugar over a library defined ReferencePointer?42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
I like your idea to keep reference a library type. Though also like Nick's syntax. A combination of both would be greaet
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
Yes - I am actually following the conversations... Another set of refactorings on the way 🙂
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
I am writing what I am learning. I had to do quite a few refactoring though 😆
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
Actually I wanted to explain the usage of Mojo's Pointer in my book.
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
Understood. Thanks!!
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
I used MutableAnyOrigin in place of MutableOrigin and it was not a type but a value... I got confused after that 🙂
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
Thanks a lot! That works!
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
mojo 2024.10.2406 (54f70ee8)
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
I am getting
42 replies
MModular
•Created by ivellapillil on 10/24/2024 in #questions
Preserving mutability when passing to function
Thanks for the response. Actually I did try that, but didn't know what to put in the
__origin_of
.. MutableAnyOrigin does not work (as it seems to expect the origin of the a_instance itself. If the function is inside the same lexical scope of as_instance
, then we can use that. But in case it is outside, it is not possible..
42 replies