Get Hy with Tryton
AI course
Rich Hickey - Clojure
"Clojure is a robust, practical, and fast programming language with a set of useful features that together form a simple, coherent, and powerful tool."
"Hy is a wonderful dialect of Lisp that’s embedded in Python."
"Since Hy transforms its Lisp code into the Python Abstract Syntax Tree, you have the whole beautiful world of Python at your fingertips, in Lisp form!"
(+ 1 2 3) (if (event? 2) "yes" "what?") (= 1 2) (defn inc2 [x] (+ 2 x))
(import [trytond.model [ModelSQL ModelView fields]]) (defclass Hello [ModelSQL ModelView] "Hello World" [--name-- "hello" name (.Char fields "Name" :required True) greeting (.Function fields (.Char fields "Greeting") "get_greeting")] (defn get-greeting [self name] (.format "Hello {}" self.name)))
@classmethod def default_company(cls): return Transaction().context.get('company')
(with-decorator classmethod (defn default-company [cls] (.get (. (Transaction) context) "company")))
(default company (.get (. (Transaction) context) "company"))
(defn default-func-name [name] (+ "default_" (.replace name "-" "_"))) (defmacro default [field args &rest body] `(with-decorator classmethod (defn ~(HySymbol (default-func-name (name field))) ~(+ [(HySymbol "cls")] args) ~@body)))
"free your mind and the rest will follow"
fgui (github & bitbucket)