^ in mojo documentation?
Hello, sorry if this is an obvious question. I am new to programming and trying to pick my next language to learn for some more serious projects. I was reading through the documentation and I can't seem to understand what the ^ symbol does. I see it is a XOR in python but I am seeing it pop up in a few places where that doesn't make sense to me. For example here: https://docs.modular.com/mojo/manual/decorators/value specifically:
fn init(inout self, owned name: String, age: Int): self.name = name^ self.age = age I am seeing it pop up a handful of times but I am thinking it could be a mistake? Looking to understand what I might be missing. Google didn't seem to have the answers. Thanks
fn init(inout self, owned name: String, age: Int): self.name = name^ self.age = age I am seeing it pop up a handful of times but I am thinking it could be a mistake? Looking to understand what I might be missing. Google didn't seem to have the answers. Thanks
@value | Modular Docs
Generates boilerplate lifecycle methods for a struct.
4 Replies
You can find an explanation here
https://docs.modular.com/mojo/manual/values/ownership#transfer-arguments-owned-and-
Ownership and borrowing | Modular Docs
How Mojo shares references through function arguments.
this blog post might be very helpful in this context
https://www.modular.com/blog/deep-dive-into-ownership-in-mojo
Modular: Deep Dive into Ownership in Mojo
We are building a next-generation AI developer platform for the world. Check out our latest post: Deep Dive into Ownership in Mojo
Perfect thank you.
Yes, it should probably get a doc page though 😉