add function tests
This commit is contained in:
parent
222a3f509b
commit
a998a57000
15
collects/tests/honu/function-use.honu
Normal file
15
collects/tests/honu/function-use.honu
Normal file
|
@ -0,0 +1,15 @@
|
|||
#lang honu
|
||||
|
||||
require "function.honu";
|
||||
|
||||
function foo (a b c){
|
||||
display("5");
|
||||
newline();
|
||||
}
|
||||
|
||||
foo(1, 2, 3);
|
||||
|
||||
function (a b c){
|
||||
display(a+b+c);
|
||||
newline();
|
||||
}(1, 2, 3);
|
9
collects/tests/honu/function.honu
Normal file
9
collects/tests/honu/function.honu
Normal file
|
@ -0,0 +1,9 @@
|
|||
#lang honu
|
||||
|
||||
provide function;
|
||||
macro function ()
|
||||
{ _ name:identifier (args:identifier ...) { body ... } }
|
||||
{ #sx scheme:syntax #sx(define (name_result args_result ...)
|
||||
(honu-unparsed-begin body ...)) }
|
||||
{ _ (args:identifier ...) { body ... }}
|
||||
{ #sx scheme:syntax #sx(lambda (args_result ...) (honu-unparsed-begin body ...)) }
|
Loading…
Reference in New Issue
Block a user