Fixed "fail" -> "failwith" in the cheat-sheet.
This commit is contained in:
parent
127a85822f
commit
8d5a099009
@ -30,7 +30,7 @@ Note that this table is not compiled before production and currently needs to be
|
|||||||
|Includes|```#include "library.ligo"```|
|
|Includes|```#include "library.ligo"```|
|
||||||
|Functions (short form)|<pre><code>function add (const a : int ; const b : int) : int is<br/> block { skip } with a + b</code></pre>|
|
|Functions (short form)|<pre><code>function add (const a : int ; const b : int) : int is<br/> block { skip } with a + b</code></pre>|
|
||||||
|Functions (long form)|<pre><code>function add (const a : int ; const b : int) : int is<br/> block { <br/> const result: int = a + b;<br/> } with result</code></pre>|
|
|Functions (long form)|<pre><code>function add (const a : int ; const b : int) : int is<br/> block { <br/> const result: int = a + b;<br/> } with result</code></pre>|
|
||||||
| If Statement | <pre><code>if age < 16 <br/>then fail("Too young to drive."); <br/>else const new_id: int = prev_id + 1;</code></pre>|
|
| If Statement | <pre><code>if age < 16 <br/>then failwith ("Too young to drive."); <br/>else const new_id: int = prev_id + 1;</code></pre>|
|
||||||
|Options|<pre><code>type middleName is option(string);<br/>const middleName : middleName = Some("Foo");<br/>const middleName : middleName = None;</code></pre>|
|
|Options|<pre><code>type middleName is option(string);<br/>const middleName : middleName = Some("Foo");<br/>const middleName : middleName = None;</code></pre>|
|
||||||
|Assignment| ```const age: int = 5;```|
|
|Assignment| ```const age: int = 5;```|
|
||||||
|Assignment on an existing variable <br/></br>*⚠️ This feature is not supported at the top-level scope, you can use it e.g. within functions. Works for Records and Maps as well.*| ```age := 18;```, ```p.age := 21``` |
|
|Assignment on an existing variable <br/></br>*⚠️ This feature is not supported at the top-level scope, you can use it e.g. within functions. Works for Records and Maps as well.*| ```age := 18;```, ```p.age := 21``` |
|
||||||
|
Loading…
Reference in New Issue
Block a user