Skip to content

Instantly share code, notes, and snippets.

@eyston
Created July 8, 2016 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyston/7e780673d544a5ac4a8b52446727fd17 to your computer and use it in GitHub Desktop.
Save eyston/7e780673d544a5ac4a8b52446727fd17 to your computer and use it in GitHub Desktop.
(defn Greeter [greeting]
(this-as this
(set! (.-greeting this) greeting)
this))
(specify! (.-prototype Greeter)
Object
(greet [this name]
(str (.-greeting this) ", " name)))
(let [greeter (Greeter. "Hello")]
(println (.greet greeter "John")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment