Commit ed04c29
committed
Playing with currying, chaining and underscores
A super hacky, quick implementation of some ideas from
https://discourse.julialang.org/t/fixing-the-piping-chaining-issue
Parse chains of `/>` and `\>` at the rough same precedence as `|>`, but
treat them as a "frontfix/backfix operator" for function calls such that
the succeeding function call becomes curried in first or last argument.
Thus, the following
x /> f(y) \> g(z)
is parsed as
(chain x (/> f y) (\> g z))
and lowered to the equivalent of
chain(x, a->f(a, y), b->g(z, b))
Also add lowering of underscore as strictly tight-binding placeholder
syntax. (Super hacky - more forms should be allowed! This is just for
experimentation).1 parent 6a12fff commit ed04c29
4 files changed
+71
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
14 | 30 | | |
15 | 31 | | |
16 | 32 | | |
| |||
125 | 141 | | |
126 | 142 | | |
127 | 143 | | |
128 | | - | |
| 144 | + | |
129 | 145 | | |
130 | 146 | | |
131 | 147 | | |
| |||
168 | 184 | | |
169 | 185 | | |
170 | 186 | | |
| 187 | + | |
171 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
172 | 197 | | |
173 | 198 | | |
174 | 199 | | |
| |||
278 | 303 | | |
279 | 304 | | |
280 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
281 | 318 | | |
282 | 319 | | |
283 | 320 | | |
284 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
285 | 325 | | |
286 | 326 | | |
287 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
| 816 | + | |
| 817 | + | |
816 | 818 | | |
817 | 819 | | |
818 | 820 | | |
| |||
867 | 869 | | |
868 | 870 | | |
869 | 871 | | |
| 872 | + | |
870 | 873 | | |
871 | 874 | | |
872 | 875 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
797 | 819 | | |
798 | 820 | | |
799 | 821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
| 940 | + | |
| 941 | + | |
940 | 942 | | |
941 | 943 | | |
942 | 944 | | |
| |||
945 | 947 | | |
946 | 948 | | |
947 | 949 | | |
| 950 | + | |
| 951 | + | |
948 | 952 | | |
949 | 953 | | |
950 | 954 | | |
| |||
0 commit comments