• Clojure
  • 14 lines
  • 113 views
  • 1 fork
  • Pasted by anonymous on April 2, 2014
; data_readers.clj
{foo some.ns/foo}

; some/ns.clj
(deftype Foo [some-field])

(defn foo [x] (Foo. x))

; REPL
> (require 'some.ns)
> #foo "5"
CompilerException java.lang.IllegalArgumentException: No matching field found: some-field for class some.ns.Foo

; remove the dash, and all is well

Did you know? CLOSE

  • There are keyboard shortcuts!
    • When Creating A Paste
      • ALT+P Toggle Private
      • CTRL+Enter Create Paste
      • ALT+W Toggle word wrap
    • When Viewing A Paste
      • ALT+G Go to a line
      • ALT+CTRL+E Edit the paste
      • ALT+R Show the raw code
  • There are URL options!
    • When Creating A Paste
      • ?lang=Javascript to default to javascript
    • When Viewing A Paste
      • #L-N Jump to line number N
?