ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
ctor
deferred_resn
demangler
enum
forall-pointer-decay
gc_noraii
jacob/cs343-translation
jenkins-sandbox
memory
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
string
with_gc
Last change
on this file since 53a2e97 was 843054c2, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago |
licencing: seventh groups of files
|
-
Property mode
set to
100644
|
File size:
378 bytes
|
Rev | Line | |
---|
[a0d9f94] | 1 | extern "C" {
|
---|
[42dcae7] | 2 | #include <stdio.h>
|
---|
[a0d9f94] | 3 | }
|
---|
| 4 |
|
---|
| 5 | forall( type T | { T ?*?( T, T ); } )
|
---|
| 6 | T square( T t ) {
|
---|
| 7 | return t * t;
|
---|
| 8 | }
|
---|
| 9 |
|
---|
| 10 | forall( type U | { U square( U ); } )
|
---|
| 11 | U quad( U u ) {
|
---|
| 12 | return square( square( u ) );
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | int main() {
|
---|
| 16 | int N = 2;
|
---|
| 17 | printf( "result of quad of %d is %d\n", N, quad( N ) );
|
---|
| 18 | }
|
---|
[42dcae7] | 19 |
|
---|
| 20 | // Local Variables: //
|
---|
| 21 | // compile-command: "../../bin/cfa quad.c" //
|
---|
| 22 | // End: //
|
---|
Note:
See
TracBrowser
for help on using the repository browser.