Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/drop-while.janet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(drop-while pos? [1 2 3 0 -4 5 6]) # -> (0 -4 5 6)

(drop-while |(> (length $) 3) ["hello" "goodbye" "hi"]) # -> ("hi")

# returns input if first element passes pred
(drop-while neg? [1 2 3 0 -4 5 6]) # -> (1 2 3 0 -4 5 6)

# compares elements as bytes and returns a string
(drop-while |(< 65 $) "foo01bar") # -> "01bar"
(drop-while |(< "A" (string/from-bytes $)) "foo01bar") # -> "01bar"
Loading