1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-25 11:44:49 +00:00

Fix last for empty collection, add tests

This commit is contained in:
Josef Pospíšil
2020-04-09 14:35:57 +02:00
parent e6d4e729fb
commit b63a0796fd
2 changed files with 5 additions and 1 deletions

View File

@@ -648,7 +648,7 @@
(defn last
"Get the last element from an indexed data structure."
[xs]
(in xs (- (length xs) 1)))
(get xs (- (length xs) 1)))
###
###