Init fennel setup

This commit is contained in:
Travis Shears 2025-07-05 13:16:01 +02:00
parent 9575795f2b
commit 8cc7a39d5a
6 changed files with 6817 additions and 1 deletions

15
hello_world/main.fnl Normal file
View file

@ -0,0 +1,15 @@
(fn love.load []
;; start a thread listening on stdin
(: (love.thread.newThread "require('love.event')
while 1 do love.event.push('stdin', io.read('*line')) end") :start))
(fn love.handlers.stdin [line]
;; evaluate lines read from stdin as fennel code
(let [(ok val) (pcall fennel.eval line)]
(print (if ok (fennel.view val) val))))
(fn love.draw []
(love.graphics.print "Hello from Fennel!\nPress any key to quit" 10 10))
(fn love.keypressed [key]
(love.event.quit))