comments yay
This commit is contained in:
15
README.md
15
README.md
@@ -30,6 +30,17 @@ const x int = 9;
|
||||
```
|
||||
---
|
||||
|
||||
### Comments
|
||||
|
||||
Comments in One start with a # and end with another # or a newline
|
||||
|
||||
```
|
||||
#this is a comment
|
||||
let a #this is also a comment# int = 9;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Scopes
|
||||
|
||||
Like in most languages, variables in One are only limited to their scope.
|
||||
@@ -62,7 +73,7 @@ let x int = 3
|
||||
let y real = 5.5;
|
||||
print(y);
|
||||
}
|
||||
print("y is now undefined again here");
|
||||
#y is now undefined again here
|
||||
{
|
||||
let y real = 0.2;
|
||||
print(y);
|
||||
@@ -223,7 +234,7 @@ The 'main' function must always return `int` and does not accept any arguments.
|
||||
|
||||
```
|
||||
fn main() int {
|
||||
print("my code here");
|
||||
#my code here
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user