M
Modular•4mo ago
zxenok

^ 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
@value | Modular Docs
Generates boilerplate lifecycle methods for a struct.
4 Replies
Martin Dudek
Martin Dudek•4mo ago
Ownership and borrowing | Modular Docs
How Mojo shares references through function arguments.
Martin Dudek
Martin Dudek•4mo ago
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
zxenok
zxenok•4mo ago
Perfect thank you.
Three chickens in the green bag
Yes, it should probably get a doc page though 😉
Want results from more Discord servers?
Add your server