| 1 | <h2>Comments</h2> |
| 2 | <pre><code>// |
| 3 | // Foobar |
| 4 | #!/usr/bin/env io |
| 5 | /* multiline |
| 6 | comment |
| 7 | */</code></pre> |
| 8 | |
| 9 | <h2>Strings</h2> |
| 10 | <pre><code>"this is a \"test\".\nThis is only a test." |
| 11 | """this is a "test". |
| 12 | This is only a test."""</code></pre> |
| 13 | |
| 14 | <h2>Numbers</h2> |
| 15 | <pre><code>123 |
| 16 | 123.456 |
| 17 | 0.456 |
| 18 | 123e-4 |
| 19 | 123e4 |
| 20 | 123.456e-7 |
| 21 | 123.456e2 |
| 22 | </code></pre> |
| 23 | |
| 24 | <h2>Full example</h2> |
| 25 | <pre><code>"Hello, world!" println |
| 26 | A := Object clone // creates a new, empty object named "A" |
| 27 | factorial := method(n, |
| 28 | if(n == 0, return 1) |
| 29 | res := 1 |
| 30 | Range 1 to(n) foreach(i, res = res * i) |
| 31 | )</code></pre> |