defmacro
This commit is contained in:
@@ -249,6 +249,10 @@ class BasicTestCase extends Test {
|
||||
function testTypeParsing() {
|
||||
_testTypeParsing();
|
||||
}
|
||||
|
||||
function testDefmacro() {
|
||||
_testDefmacro();
|
||||
}
|
||||
}
|
||||
|
||||
class BasicObject {
|
||||
|
@@ -370,4 +370,13 @@
|
||||
(Assert.equals 5 (doSomething (lambda [i] i)))
|
||||
(Assert.equals 7 (doSomething (lambda [i] (+ i 2))))
|
||||
// Pass null to the really crazy one because I'm lazy:
|
||||
(Assert.equals "but it still compiles" (itsAMonster null)))
|
||||
(Assert.equals "but it still compiles" (itsAMonster null)))
|
||||
|
||||
(defmacro defconstfunc [name const] `(defun ,name [] ,const))
|
||||
|
||||
(defconstfunc func5 5)
|
||||
(defconstfunc funcHello "hello")
|
||||
|
||||
(defun _testDefmacro []
|
||||
(Assert.equals 5 (func5))
|
||||
(Assert.equals "hello" (funcHello)))
|
Reference in New Issue
Block a user