Mojo (programming language): Difference between revisions

Content deleted Content added
Line 62:
Basic arithmetic operations in Mojo with a {{mono|def}} function:
 
<syntaxhighlight lang="Pythonmojo">
def sub(x, y):
"""A pythonic subtraction."""
Line 71:
and with an {{mono|fn}} function:
 
<syntaxhighlight lang="rustmojo">
fn add(x: Int, y: Int) -> Int:
"""A rustacean addition."""
Line 81:
 
Variable declaration and usage in Mojo:
<syntaxhighlight lang="rustmojo">
fn main():
let x = 1