[honu] add two more tests
This commit is contained in:
parent
918c87e96b
commit
a606f6614b
16
collects/tests/honu/math.honu
Normal file
16
collects/tests/honu/math.honu
Normal file
|
@ -0,0 +1,16 @@
|
|||
#lang honu
|
||||
|
||||
macro add_all(){
|
||||
number:expression ...
|
||||
} {
|
||||
syntax(
|
||||
$ number + $ ... 0
|
||||
)
|
||||
/*
|
||||
syntax(
|
||||
$ printf("~a\n", number) $ ...
|
||||
)
|
||||
*/
|
||||
}
|
||||
|
||||
add_all 1 2 3 * 4;
|
14
collects/tests/honu/where.honu
Normal file
14
collects/tests/honu/where.honu
Normal file
|
@ -0,0 +1,14 @@
|
|||
#lang honu
|
||||
|
||||
var where = 0
|
||||
|
||||
macro varwhere(where =){ unparsed where bind:identifier = any:expression }
|
||||
{ syntax({var bind = any
|
||||
unparsed}) }
|
||||
|
||||
varwhere { printf("x is ~a\n", x)
|
||||
{
|
||||
var x = 5;
|
||||
x * 2
|
||||
}
|
||||
} where x = 2 + 1
|
Loading…
Reference in New Issue
Block a user