mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 14:13:52 +01:00

- Add type annotations: [type] statement - Add type definitions: [[name] type], [[name] := statement] - Add type annotations example (08) - add Quickstart.md, reference it from README
48 lines
679 B
Markdown
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
|