mers/Quickstart.md
Mark 4144d6cf71 Type Annotations
- Add type annotations: [type] statement
- Add type definitions: [[name] type], [[name] := statement]
- Add type annotations example (08)
- add Quickstart.md, reference it from README
2023-11-21 22:10:58 +01:00

48 lines
679 B
Markdown

# 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