fix "boolean-if-else.md"

This commit is contained in:
Lesenechal Remi 2019-12-25 23:38:37 +01:00
parent bddad3f234
commit 9a5800dc3e

View File

@ -11,18 +11,18 @@ Here's how to define a boolean:
<!--DOCUSAURUS_CODE_TABS-->
<!--Pascaligo-->
```pascaligo
```pascaligo group=a
const a: bool = True;
const b: bool = False;
```
<!--CameLIGO-->
```cameligo
```cameligo group=a
let a: bool = true
let b: bool = false
```
<!--ReasonLIGO-->
```reasonligo
```reasonligo group=a
let a: bool = true;
let b: bool = false;
```
@ -37,24 +37,24 @@ In LIGO, only values of the same type can be compared. We call these "comparable
<!--DOCUSAURUS_CODE_TABS-->
<!--Pascaligo-->
```pascaligo
```pascaligo group=b
const a: string = "Alice";
const b: string = "Alice";
// True
const c: bool = (a = b);
```
<!--CameLIGO-->
```cameligo
```cameligo group=b
let a: string = "Alice"
let b: string = "Alice"
// true
let c: bool = (a = b)
```
<!--ReasonLIGO-->
```reasonligo
```reasonligo group=b
let a: string = "Alice";
let b: string = "Alice";
/* true */
(* true *)
let c: bool = (a == b);
```
<!--END_DOCUSAURUS_CODE_TABS-->
@ -64,7 +64,7 @@ let c: bool = (a == b);
<!--DOCUSAURUS_CODE_TABS-->
<!--Pascaligo-->
```pascaligo
```pascaligo group=c
const a: int = 5;
const b: int = 4;
const c: bool = (a = b);
@ -75,7 +75,7 @@ const g: bool = (a >= b);
const h: bool = (a =/= b);
```
<!--CameLIGO-->
```cameligo
```cameligo group=c
let a: int = 5
let b: int = 4
let c: bool = (a = b)
@ -83,11 +83,11 @@ let d: bool = (a > b)
let e: bool = (a < b)
let f: bool = (a <= b)
let g: bool = (a >= b)
let h: bool = (a =/= b)
let h: bool = (a <> b)
```
<!--ReasonLIGO-->
```reasonligo
```reasonligo group=c
let a: int = 5;
let b: int = 4;
let c: bool = (a == b);
@ -106,23 +106,23 @@ let h: bool = (a != b);
<!--DOCUSAURUS_CODE_TABS-->
<!--Pascaligo-->
```pascaligo
```pascaligo group=d
const a: tez = 5mutez;
const b: tez = 10mutez;
const c: bool = (a = b);
```
<!--CameLIGO-->
```cameligo
```cameligo group=d
let a: tez = 5mutez
let b: tez = 10mutez
// false
let c: bool = (a = b)
```
<!--ReasonLIGO-->
```reasonligo
```reasonligo group=d
let a: tez = 5mutez;
let b: tez = 10mutez;
/* false */
(* false *)
let c: bool = (a == b);
```
<!--END_DOCUSAURUS_CODE_TABS-->
@ -136,7 +136,7 @@ Conditional logic is an important part of every real world program.
<!--DOCUSAURUS_CODE_TABS-->
<!--Pascaligo-->
```pascaligo
```pascaligo group=e
const min_age: nat = 16n;
(*
@ -162,7 +162,7 @@ function is_adult(const age: nat): bool is
> ```
<!--CameLIGO-->
```cameligo
```cameligo group=e
let min_age: nat = 16n
(**
@ -177,17 +177,17 @@ let is_adult (age: nat) : bool =
if (age > min_age) then true else false
```
<!--ReasonLIGO-->
```reasonligo
```reasonligo group=e
let min_age: nat = 16n;
/**
(**
This function is really obnoxious, but it showcases
how the if statement and it's syntax can be used.
Normally, you'd use `with (age > min_age)` instead.
*/
*)
let is_adult = (age: nat): bool =>
if (age > min_age) {