Changes in src/examples/prolog.c [b63e376:4040425]
- File:
-
- 1 edited
-
src/examples/prolog.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/examples/prolog.c
rb63e376 r4040425 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 8 22:09:39201613 // Update Count : 512 // Last Modified On : Wed Mar 2 18:11:18 2016 13 // Update Count : 2 14 14 // 15 15 16 #include <fstream> 16 extern "C" { extern int printf( const char *fmt, ... ); } 17 17 18 void printResult( int x ) { sout | "int" | endl; }19 void printResult( double x ) { sout | "double" | endl; }20 void printResult( char * x ) { sout | "char*" | endl; }18 void printResult( int x ) { printf( "int\n" ); } 19 void printResult( double x ) { printf( "double\n" ); } 20 void printResult( char * x ) { printf( "char*\n" ); } 21 21 22 22 void is_arithmetic( int x ) {} … … 25 25 void is_integer( int x ) {} 26 26 27 trait ArithmeticType( otype T ) {27 trait ArithmeticType( type T ) { 28 28 void is_arithmetic( T ); 29 29 }; 30 30 31 trait IntegralType( otype T | ArithmeticType( T ) ) {31 trait IntegralType( type T | ArithmeticType( T ) ) { 32 32 void is_integer( T ); 33 33 }; 34 34 35 forall( otype T | IntegralType( T ) | { void printResult( T ); } )35 forall( type T | IntegralType( T ) | { void printResult( T ); } ) 36 36 void hornclause( T param ) { 37 37 printResult( param );
Note:
See TracChangeset
for help on using the changeset viewer.