- Introduction
- Platform
- Tutorial
- Language reference
- Verbs
- Iterators
- Queries
- Dynamic parsers
- Language idioms
- Standard library
- Plugins
- For Python developers
- For KDB+ developers
- Application examples
- FAQ
Monadic last
Rеturns the last element from x
if x
is list, else rеturns x
.
Syntax: last <x>
; last[<x>]
; _<x>
o)last 1 2 3 4
4
o)last 1
1
o)_ 1 2 3 4
4
o)_ 1
1
o)last ("asd";1 2 3 4)
1 2 3 4
o)last each (1; 2 3 4; `five `six)
1
4
`six
o)
Do not use _ at the beginning of names. You get last after binding.
o)_t:1 2 3
3
o)