ModularM
Modular2y ago
4 replies
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
Generates boilerplate lifecycle methods for a struct.
@value | Modular Docs
Was this page helpful?