Right: Difference between revisions

From The K Language Wiki
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
{{primitive|(:)}}
{{primitive|(:)}}
'''Right''', a.k.a. '''dex''', is a function that returns its rightmost argument.
'''Right''', a.k.a. '''dex''' (from Latin [https://en.wiktionary.org/wiki/dexter#Latin ''dexter'']), is a function that returns its rightmost argument.
(:)[1;2]
(:)[1;2]
2
2

Revision as of 19:20, 8 July 2021

Right
(:)

Right, a.k.a. dex (from Latin dexter), is a function that returns its rightmost argument.

 (:)[1;2]
2

When it accepts only one argument, it could be referred to as identity or identity function.

 (::)1
1

In some dialects the identity function could serve as a placeholder for missing indices in square-bracket indexing or for missing arguments in projections.