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