-- aldor -grun -laldor foo.as
--:foo(1) = [1]
-- aldor -grun -laldor -DC1 foo.as
--:foo(1) = [-1]

#include "aldor"

Foo(R: OutputType with {coerce: MachineInteger -> %}): OutputType with {
	foo: R -> %;
	foo: MachineInteger -> %;
} == List R add {
	Rep == List R;
	import from Rep, R;
#if C1
	foo(i: MachineInteger): % == per [(-i) :: R];
	foo(r: R): % == per [r];
#else
	foo(r: R): % == per [r];
	foo(i: MachineInteger): % == per [(-i) :: R];
#endif
}
main(): () == {
	import from MachineInteger, Foo MachineInteger;
	import from TextWriter, Character, String;
	stdout << "foo(1) = "<< foo(1) << newline;
	flush! stdout;
}

main();




