Skip to content

Instantly share code, notes, and snippets.

@echupriyanov
Last active August 29, 2015 13:57
Show Gist options
  • Save echupriyanov/9758230 to your computer and use it in GitHub Desktop.
Save echupriyanov/9758230 to your computer and use it in GitHub Desktop.
Problematic gen-class
(ns task02.Database
(:gen-class
; :methods [^:static [InitDatabase [] void]
; ^:static [Select [String] String]]
; :main false
:prefix -
)
(:use [task02 db query])
)
;; Объявить класс task02.Database с двумя статическими функциями доступными из Java:
;; - void InitDatabase() - должна выполнять начальную загрузку данных используя функцию
;; task02.db/load-initial-data
;; - String Select(String query) - должна выполнять запрос к базе данных
;; (task02.query/perform-query) и возвращать результат в виде строки в формате EDN.
;; Hint: load-initial-data, pr-str, perform-query
; :implement-me
(defn -InitDatabase [] ; not generated without explicit declaration
(load-initial-data))
(defn -Select [^String s] ; not generated without explicit declaration
(pr-str (perform-query s)))
(defn -toString [this] ; generated
"Hi, there!")
(defn -myLovelyMethod ; not generated without explicit declaration
[this]
"Long live Clojure!"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment