fix bug in rest with error on empty list

This commit is contained in:
Scott Richmond 2024-06-20 16:18:54 -04:00
parent 2c1de39161
commit 42492c8a09
2 changed files with 3 additions and 5 deletions

View File

@ -134,6 +134,8 @@ fn fn? {
& what we need for some very basic list manipulation
fn rest {
"Returns all but the first element of a list or tuple, as a list."
([]) -> []
(()) -> ()
(xs as :list) -> base :rest (xs)
(xs as :tuple) -> base :rest (xs)
}

View File

@ -52,11 +52,7 @@
(comment
# (do
(def source `
hideturtle! ()
showturtle! ()
penup! ()
pendown! ()
pencolor! (colors :red)
rest ([])
`)
(def out (-> source
ludus