diff --git a/collects/tests/honu/struct-patterns.honu b/collects/tests/honu/struct-patterns.honu new file mode 100644 index 0000000000..dd7d0d03f1 --- /dev/null +++ b/collects/tests/honu/struct-patterns.honu @@ -0,0 +1,5 @@ +#lang honu + +provide structField; + +pattern structField (name_result) [name:identifier]; diff --git a/collects/tests/honu/struct-use.honu b/collects/tests/honu/struct-use.honu new file mode 100644 index 0000000000..6147e1a10e --- /dev/null +++ b/collects/tests/honu/struct-use.honu @@ -0,0 +1,12 @@ +#lang honu + +require "struct.honu"; + +struct foo {a b c}; + +z = foo(1, 2, 3); +y = 3; +y = 9; +// x = foo(1, 2, 3); + +display(z.a); diff --git a/collects/tests/honu/struct.honu b/collects/tests/honu/struct.honu new file mode 100644 index 0000000000..7fa24d9236 --- /dev/null +++ b/collects/tests/honu/struct.honu @@ -0,0 +1,10 @@ +#lang honu + +require (forSyntax "struct-patterns.honu"); + +provide struct; +macro struct () { + _ name {field:structField ...} ; +} { + schemeSyntax#sx(honu-struct name (field_name_result ...)) +}