Merge branch 'paultag/feature/support-question-marks' of https://github.com/paultag/hy into paultag-paultag/feature/support-question-marks
Conflicts: hy/core/language.hy
This commit is contained in:
commit
cc147512fc
7
NEWS
7
NEWS
@ -1,3 +1,10 @@
|
||||
Changes from Hy 0.9.11
|
||||
|
||||
[ Misc. Fixes ]
|
||||
[ Syntax Fixes ]
|
||||
[ Language Changes ]
|
||||
* Translate foo? -> is_foo, for better Python interop. (PT)
|
||||
|
||||
Changes from Hy 0.9.10
|
||||
|
||||
* Many thanks to Guillermo Vayá (Willyfrog) for preparing this release's
|
||||
|
@ -218,9 +218,7 @@
|
||||
(_numeric_check n)
|
||||
(= n 0))
|
||||
|
||||
(def *exports* ["cycle" "dec" "distinct" "drop" "drop_while" "empty?"
|
||||
"even?" "filter" "float?" "inc"
|
||||
"instance?" "integer?" "iterable?" "iterate" "iterator?" "neg?"
|
||||
"none?" "nth" "numeric?" "odd?" "pos?" "remove" "repeat"
|
||||
"repeatedly" "second" "string" "string?" "take" "take_nth" "take_while"
|
||||
"zero?"])
|
||||
(def *exports* '[cycle dec distinct drop drop-while empty? even? filter float?
|
||||
inc instance? integer? iterable? iterate iterator? neg? none?
|
||||
nth numeric? odd? pos? remove repeat repeatedly second string
|
||||
string? take take-nth take-while zero?])
|
||||
|
@ -238,6 +238,9 @@ def t_identifier(p):
|
||||
if "-" in obj and obj != "-":
|
||||
obj = obj.replace("-", "_")
|
||||
|
||||
if obj.endswith("?") and obj != "?":
|
||||
obj = "is_%s" % (obj[:-1])
|
||||
|
||||
return HySymbol(obj)
|
||||
|
||||
|
||||
|
@ -551,6 +551,12 @@
|
||||
(assert (= -_- "what?"))))
|
||||
|
||||
|
||||
(defn test-symbol-question-mark []
|
||||
"NATIVE: test foo? -> is_foo behavior"
|
||||
(let [[foo? "nachos"]]
|
||||
(assert (= is_foo "nachos"))))
|
||||
|
||||
|
||||
(defn test-and []
|
||||
"NATIVE: test the and function"
|
||||
(let [[and123 (and 1 2 3)]
|
||||
|
Loading…
Reference in New Issue
Block a user