Skip to content

Instantly share code, notes, and snippets.

@pbalduino
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save pbalduino/57482522946f5b8f7b30 to your computer and use it in GitHub Desktop.

Select an option

Save pbalduino/57482522946f5b8f7b30 to your computer and use it in GitHub Desktop.
Criando uma classe Java com Clojure
;; criei um arquivo chamado gen.clj
(ns capitulo08.gen
(:gen-class
:name "capitulo08.Uia"
:methods [[hello [] void]]))
(defn -hello [this]
(println "Olá!"))
;; agora no REPL:
(compile (symbol "capitulo08.gen"))
(import 'capitulo08.Uia)
(.hello (Uia.))
; Olá!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment