Hacker News new | past | comments | ask | show | jobs | submit login

Nice examples. Am I correct in guessing that this code:

    (ns com.stuartsierra.component
      (:require [com.stuartsierra.dependency :as dep]
            [com.stuartsierra.component.platform :as platform]))

requires the correct platform.clj or platform.cljs depending on the runtime?

And that this:

    #?(:clj
       (defmethod clojure.core/print-method SystemMap
         [system ^java.io.Writer writer]
         (.write writer "#<SystemMap>"))
       :cljs
       (extend-protocol IPrintWithWriter
         SystemMap
         (-pr-writer [this writer opts]
           (-write writer "#<SystemMap>"))))
is how you perform different operations in a single file based on runtime?



The first part requires platform on both platforms. You are correct about the latter.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: