diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-07-18 12:14:16 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-07-18 12:14:16 +0100 |
commit | 64a814d49375b8eb63f96a51aa9847b7e56f226f (patch) | |
tree | 2f267b4610316a498d0e1068683919a5207382f5 /docs | |
parent | 6427d793418458ea30a23d3b11efd6a75bf6dc1e (diff) | |
download | micro-lang-64a814d49375b8eb63f96a51aa9847b7e56f226f.tar.gz micro-lang-64a814d49375b8eb63f96a51aa9847b7e56f226f.zip |
Examples and fixes
Diffstat (limited to 'docs')
-rw-r--r-- | docs/tour.md | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/docs/tour.md b/docs/tour.md index 452b5a9..6f434aa 100644 --- a/docs/tour.md +++ b/docs/tour.md @@ -27,10 +27,16 @@ See also the built-in functions. ### Identifiers -Identifiers can be any string starting with a later (upper or lower case) or underscore (`_`), followed by the same type of character or a numeric value. +Identifiers can be any string starting with a letter (upper or lower case) or underscore (`_`), followed by the same type of character or a numeric value. An identifier can't be a reserved word. +```micro +var example number; +var _example number; +var example2 number; +``` + ### Blocks and scope Micro has series of statements in blocks delimited with `{` and `}`, and a block defines a lexical scope. @@ -103,7 +109,7 @@ var a number = fn(); See functions for more information about the "func" type. -Number supports the following formats: +Numbers support the following formats: * 0 decimal * 0x00 hexadecimal @@ -134,7 +140,7 @@ fn(); Constants are immutable values. -Constants can be literals or expressions that get evaluated at compilation time. +Constants can be literals or expressions that get evaluated at parsing time. ```micro const K number = 10; @@ -463,10 +469,9 @@ These are available on the interpreter. | `len` | returns the size in elements of a variable of type array | `len(arr);` | | `panic` | ends execution with a message and a runtime error | `panic("message");` | | `println` | writes to standard output a variable list of expressions, followed by an end of line; returns number of bytes written | `println("value: ", a);` | -| `str` | used with arrays of uint8 to convert them as a printable string | `println(str(arr));` | ## To do -See [TODO](todo.md) for features that are planned but not yet implemented. +See [TODO](../todo.md) for features that are planned but not yet implemented. |