source: translator/quad.c @ 51b7345

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 51b7345 was 51b7345, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

initial commit

  • Property mode set to 100644
File size: 361 bytes
Line 
1// "./cfa quad.c"
2// "./cfa -CFA quad.c > quad_out.c"
3// "gcc31 -g quad_out.c LibCfa/libcfa.a"
4
5#include <stdio.h>
6
7forall( type T | { T ?*?( T, T ); } )
8T square( T t )
9{
10  return t * t;
11}
12
13forall( type U | { U square( U ); } )
14U quad( U u )
15{
16  return square( square( u ) );
17}
18
19int
20main()
21{
22  printf( "result of quad of 5 is %d\n", quad( 5 ) );
23  return 0;
24}
Note: See TracBrowser for help on using the repository browser.