mers/Quickstart.md

48 lines
679 B
Markdown
Raw Permalink Normal View History

# Hello, World!
```
"Hello, World!".println
```
This calls the `println` function with the argument
`"Hello, World!"` (a string).
`println` then prints the argument (to stdout),
causing it to show up in your terminal.
# Hello, Variable!
To declare a variable in mers, use `:=`:
```
greeting := "Hello, World!"
```
To retrieve its value, simply write its name.
```
greeting.println
```
# Conditions
(todo)
# Functions
Functions represent actions. Many represent transformations from some input to some output.
They are written as `argument -> action`:
```
a -> if a false else true
```
# Types
(todo)
## Type Annotations
## Custom Types
### Defining Custom Types