Custom operators

From The K Language Wiki
Revision as of 03:59, 6 July 2023 by Razetime (talk | contribs) (add example with desc)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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:

(⍴:):1+
(⍴):#

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