Custom operators: Difference between revisions

Content added Content deleted
(Create stub)
 
(add example with desc)
 
Line 1: Line 1:
'''Custom operators''' using Unicode characters were introduced by [[ngn/k]] as ''defined verbs''.
'''Custom operators''' using Unicode characters were introduced by [[ngn/k]] as ''defined verbs''.

ngn/k allows definitions of monadic and dyadic overloads for defined verbs, as follows:

<pre>
(⍴:):1+
(⍴):#</pre>

The syntax for the definition also defines how the operator is used. A <code>:</code> is mandatory for using a monadic overload. K will otherwise assume partial application.


[[Category:Features]]
[[Category:Features]]