Skip to content

Instantly share code, notes, and snippets.

@jaawerth
Forked from turbo/test.fnl.clj
Last active October 18, 2019 22:14
Show Gist options
  • Save jaawerth/08c27ee939e475157fa0f4cc1cddb7ef to your computer and use it in GitHub Desktop.
Save jaawerth/08c27ee939e475157fa0f4cc1cddb7ef to your computer and use it in GitHub Desktop.
; vi: ft=clojure
(macro make [receiver classtable ...]
`(local ,receiver (doto (class ,(tostring receiver) ,classtable)
,...)))
; Handler that takes a single argument 'username'
(make UserHandler turbo.web.RequestHandler
(tset :get (fn [self name]
(self:write (.. "Username is " name)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment