mirror of
https://github.com/janet-lang/janet
synced 2026-10-08 16:51:41 +00:00
Improve docstring for last (#1829)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
This commit is contained in:
+8
-3
@@ -909,9 +909,14 @@
|
||||
(get x 0))
|
||||
|
||||
(defn last
|
||||
"Get the last element from an indexed data structure."
|
||||
[xs]
|
||||
(get xs (- (length xs) 1)))
|
||||
``
|
||||
Get the final element from `x`.
|
||||
|
||||
`x` can be a bytes, indexed, or abstract type value with suitable
|
||||
`get` and `length` methods.
|
||||
``
|
||||
[x]
|
||||
(get x (- (length x) 1)))
|
||||
|
||||
## Polymorphic comparisons
|
||||
|
||||
|
||||
Reference in New Issue
Block a user