Update README.md. Add Variable docs.
This commit is contained in:
parent
ca6d836361
commit
5a52887489
25
README.md
25
README.md
|
|
@ -50,6 +50,28 @@ Animal/Dog -> [Mammal, Domesticated] {
|
|||
}
|
||||
```
|
||||
|
||||
### Variables
|
||||
|
||||
Variables are always Protected scoped.
|
||||
There is no way to make them Public or Private.
|
||||
This is by design.
|
||||
|
||||
#### Variable Declaration
|
||||
|
||||
##### Declare Now, Set later
|
||||
```waddle
|
||||
Integer num;
|
||||
|
||||
fn on_create(Integer my_num) -> [None] {
|
||||
my.num.set(my_num);
|
||||
}
|
||||
```
|
||||
|
||||
##### Declare and Set at same time
|
||||
```waddle
|
||||
Integer num.set(1000);
|
||||
```
|
||||
|
||||
### Functions
|
||||
|
||||
#### Function declaration
|
||||
|
|
@ -203,8 +225,7 @@ result = Boolean.and(
|
|||
#### Object Method Boolean Checks
|
||||
```waddle
|
||||
if(my.age.gt(18).and(my.status.is(Verified))){
|
||||
my.age.gt(18),
|
||||
my.status.is(Verified)
|
||||
// Pass check
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue