honeylisp/link/init.fnl
2020-11-19 23:35:39 -05:00

12 lines
285 B
Fennel

(local link
{:switch
(fn [self name]
(set self.machine (require (.. "link." name)))
(set self.name name))
:types [:serial :tape :mame]})
(local serial (require :link.serial))
(link:switch (if (and (pcall #(serial:connect)) (serial:connected?)) :serial :mame))
link