finally fixed access to hy.core.macros here. have to explicitly require them
This commit is contained in:
parent
d9dee8ec67
commit
7e8a7edbdc
@ -23,17 +23,7 @@
|
|||||||
;;;; to make functional programming slightly easier.
|
;;;; to make functional programming slightly easier.
|
||||||
;;;;
|
;;;;
|
||||||
|
|
||||||
;;;; These are local-only macros that are copied from hy.core.macros since
|
(require hy.core.macros)
|
||||||
;;;; those are invisible here.
|
|
||||||
(defmacro -if-python2-local- [python2-form python3-form]
|
|
||||||
(import sys)
|
|
||||||
(if (< (get sys.version_info 0) 3)
|
|
||||||
python2-form
|
|
||||||
python3-form))
|
|
||||||
|
|
||||||
;;;;
|
|
||||||
;;;;
|
|
||||||
|
|
||||||
|
|
||||||
(defn _numeric-check [x]
|
(defn _numeric-check [x]
|
||||||
(if (not (numeric? x))
|
(if (not (numeric? x))
|
||||||
@ -111,7 +101,7 @@
|
|||||||
|
|
||||||
(defn integer? [x]
|
(defn integer? [x]
|
||||||
"Return True if x in an integer"
|
"Return True if x in an integer"
|
||||||
(-if-python2-local-
|
(if-python2
|
||||||
(isinstance x (, int long))
|
(isinstance x (, int long))
|
||||||
(isinstance x int)))
|
(isinstance x int)))
|
||||||
|
|
||||||
@ -189,7 +179,7 @@
|
|||||||
|
|
||||||
(defn string? [x]
|
(defn string? [x]
|
||||||
"Return True if x is a string"
|
"Return True if x is a string"
|
||||||
(-if-python2-local-
|
(if-python2
|
||||||
(isinstance x (, str unicode))
|
(isinstance x (, str unicode))
|
||||||
(isinstance x str)))
|
(isinstance x str)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user