JanetDocsPlaygroundI'm feeling luckyGitHub sign in
# Setup (spit "poem.txt" "I’ve decided to tackle it\nIt’s going to get done") # A version of head -n 1, but entirely in Janet # Note, that because files in Janet support :close as a method # we don't have to define a dtor. # There might be other closing work to do, of course (with [f (file/open "poem.txt")] (print (:read f :line))) # => "I've decided to tackle it"