ogma icon indicating copy to clipboard operation
ogma copied to clipboard

Add `\` overload handling calling a `Nil` def

Open kurtlawrence opened this issue 2 years ago • 0 comments

This syntax would be useful for patterns such as append \+ $i.foo $i.bar. That is, where the + is usually typed and will not work on an input such as TableRow. Typically, the pattern is append { let {get bar} $b | get foo | + $b }.

Generalising this is tricky.

Implementation option

The \<cmd> arg1 arg2 ... argN is sugar for an intrinsic, which will amount to let $i | \#n | <cmd> arg1 arg2 ... argN. This benefits from having <cmd> be whatever is already defined, along with doing the let $i portion. The drawback is cmds (such as +) would now need a Nil input, which is going to place further burden on the inferencer.

  • [ ] Bikeshed $i
  • [ ] #112

kurtlawrence avatar Jul 05 '22 03:07 kurtlawrence