Browse Source

upd docs - pattern matching

221V 3 months ago
parent
commit
20bbf8cfc6
1 changed files with 8 additions and 6 deletions
  1. 8 6
      docs/readme.md

+ 8 - 6
docs/readme.md

@@ -162,7 +162,7 @@ int my_func(int x) {
 
 ```
 // left = function type, right = arguments type
-// sw = use switch
+// sw for use switch
 int sw = int x
 my_func 1 = 1
 my_func 5 = 5 * 2
@@ -186,7 +186,8 @@ int my_func(int x) {
 ```
 
 ```
-y = case x
+// ptn = pattern = for pattern matching like `case X of` in erlang
+y = ptn x
   1 = 1
   5 = 5 * 2
   9 = 9 * 3
@@ -206,8 +207,8 @@ if (x == 1){
 ```
 
 ```
-// sw case = use switch in dlang for this case
-y = sw case x
+// ptns = use switch in dlang for this pattern matching
+y = ptns x
   1 = 1
   5 = 5 * 2
   9 = 9 * 3
@@ -408,8 +409,9 @@ __VERSION__
 dlang
 use
 as
-case
-sw case
+sw
+ptn
+ptns
 ```
 todo