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
|
### Functions
|
||||||
|
|
||||||
#### Function declaration
|
#### Function declaration
|
||||||
|
|
@ -203,8 +225,7 @@ result = Boolean.and(
|
||||||
#### Object Method Boolean Checks
|
#### Object Method Boolean Checks
|
||||||
```waddle
|
```waddle
|
||||||
if(my.age.gt(18).and(my.status.is(Verified))){
|
if(my.age.gt(18).and(my.status.is(Verified))){
|
||||||
my.age.gt(18),
|
// Pass check
|
||||||
my.status.is(Verified)
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue