1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-11 00:52:44 +03:00
mal/hy/mal_types.hy
2017-09-21 23:15:51 -05:00

16 lines
459 B
Hy

(import [types :as pytypes])
(defclass MalException [Exception]
(defn --init-- [self val] (setv self.val val)))
(defclass Atom []
(defn --init-- [self val] (setv self.val val)))
(defn clone [obj]
(if (= (type obj) pytypes.FunctionType)
(pytypes.FunctionType obj.__code__ obj.__globals__
:name obj.__name__
:argdefs obj.__defaults__
:closure obj.__closure__)
obj))