// // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // simple.c -- // // Author : Richard C. Bilson // Created On : Wed May 27 17:56:53 2015 // Last Modified By : Peter A. Buhr // Last Modified On : Wed May 27 18:30:27 2015 // Update Count : 3 // extern "C" { int printf( const char *fmt, ... ); } context has_star( type T ) { T ?*?( T, T ); }; int ?*?( int, int ); int ?=?( int *, int ); forall( type T | has_star( T ) ) T square( T t ) { return t * t; } int main() { printf( "result of square of 5 is %d\n", square( 5 ) ); } // Local Variables: // // tab-width: 4 // // compile-command: "cfa simple.c" // // End: //