This commit is contained in:
Scott Richmond 2024-06-15 22:18:58 -04:00
parent e3cbb4ad57
commit 81915ed4ba

View File

@ -1,11 +1,4 @@
& this file, uniquely, gets `base` loaded as context. See src/ludus/base.cljc for exports & this file, uniquely, gets `base` loaded as context. See src/base.janet for exports
&&& TODO
& functions to add:
& true?
& set?
& tuple?
& ref?
& some forward declarations & some forward declarations
& TODO: fix this so that we don't need (as many of) them & TODO: fix this so that we don't need (as many of) them
@ -254,7 +247,6 @@ fn concat {
(xs, ys, ...zs) -> fold (concat, zs, concat (xs, ys)) (xs, ys, ...zs) -> fold (concat, zs, concat (xs, ys))
} }
fn set { fn set {
"Takes an ordered collection--list or tuple--and turns it into a set." "Takes an ordered collection--list or tuple--and turns it into a set."
(xs as :list) -> fold (append, xs, ${}) (xs as :list) -> fold (append, xs, ${})
@ -662,7 +654,7 @@ fn butlast {
} }
fn slice { fn slice {
"Returns a slice of a list, representing a sub-list." "Returns a slice of a list or a string, representing a sub-list or sub-string."
(xs as :list, end as :number) -> slice (xs, 0, end) (xs as :list, end as :number) -> slice (xs, 0, end)
(xs as :list, start as :number, end as :number) -> when { (xs as :list, start as :number, end as :number) -> when {
gte? (start, end) -> [] gte? (start, end) -> []