From 218672555b561f73b25f07168d16b24c56a494d4 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 11 Nov 2011 05:53:12 +0000 Subject: * interp/compiler.boot (applyMapping): Emit special call for domain producing mapping variables. (compWithMappingMode): Coerce constructors to function objets. (compFormWithModemap): Constructor calls are direct calls. Everything else is ordinary indirect call. * interp/g-opt.boot (optCall): Handle function objects. * interp/nruncomp.boot (NRTencode): Encode the elaboration of atomic forms, not the source level form. * testsuite/compiler/ctor-mapping.spad: New. --- src/testsuite/compiler/ctor-mapping.spad | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/testsuite/compiler/ctor-mapping.spad (limited to 'src/testsuite') diff --git a/src/testsuite/compiler/ctor-mapping.spad b/src/testsuite/compiler/ctor-mapping.spad new file mode 100644 index 00000000..4f7a58d2 --- /dev/null +++ b/src/testsuite/compiler/ctor-mapping.spad @@ -0,0 +1,17 @@ +++ Contributed by Gabriel Dos Reis; November 2011. +++ Test conversion of constructors to function objects and +++ elaboration of domain producting function parameters. + +)abbrev package BAR Bar +Bar(F: Type -> Type): Public == Private where + Public == Type with + bar: () -> Type + Private == add + bar() == F Integer + + +)abbrev package FOO Foo +Foo(): Type with + foo: () -> Type + == add + foo() == bar()$Bar(List) -- cgit v1.2.3