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:
Nicolas Dandrimont 2013-12-05 19:28:59 +01:00
commit cc147512fc
4 changed files with 20 additions and 6 deletions

7
NEWS
View File

@ -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

View File

@ -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?])

View File

@ -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)

View File

@ -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)]