source: translator/simple.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: 307 bytes
Line 
1// './cfa square.c'
2
3context has_star( type T )
4{
5  T ?*?( T, T );
6};
7
8int ?*?( int, int );
9extern "C" { void printf( const char *, ... ); }
10int ?=?( int*, int );
11
12forall( type T | has_star( T ) )
13T
14square( T t )
15{
16  return t * t;
17}
18
19int
20main()
21{
22  printf( "result of square of 5 is %d\n", square( 5 ) );
23}
Note: See TracBrowser for help on using the repository browser.