add function tests

This commit is contained in:
Jon Rafkind 2010-07-13 10:46:56 -06:00
parent 222a3f509b
commit a998a57000
2 changed files with 24 additions and 0 deletions

View 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);

View 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 ...)) }