Skip to content

Instantly share code, notes, and snippets.

@kindlychung
Last active August 29, 2015 14:18
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 kindlychung/efa8ae27afb7386fb163 to your computer and use it in GitHub Desktop.
Save kindlychung/efa8ae27afb7386fb163 to your computer and use it in GitHub Desktop.
(defproject testclojure "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/core.typed "0.2.84"]
[alembic "0.3.2"]]
:main ^:skip-aot testclojure.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
(ns testclojure.core
(:gen-class)
(:require [clojure.core.typed :refer [ann AnyInteger check-ns]])
(:import [clojure.lang ISeq]))
(ann ^:no-check clojure.core/mod [AnyInteger AnyInteger -> AnyInteger])
(ann div-by [AnyInteger AnyInteger -> Boolean])
(defn div-by [x y]
(== (mod y x) 0))
(ann div-by-3-or-5 [AnyInteger -> Boolean])
(defn div-by-3-or-5 [x]
(or (div-by 3 x) (div-by 5 x)))
(ann euler1 [AnyInteger -> AnyInteger])
(defn euler1 [n]
(reduce + (filter div-by-3-or-5 (range n))))
(ann -main [-> nil] )
(defn -main []
(prn (euler1 "a")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment