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 a65d92e was
a65d92e,
checked in by Peter A. Buhr <pabuhr@…>, 9 years ago
|
regression testing, second attempt
|
-
Property mode set to
100644
|
File size:
523 bytes
|
Line | |
---|
1 | context addable(type T) { |
---|
2 | T ?+?(T,T); |
---|
3 | }; |
---|
4 | |
---|
5 | type List(type T | addable(T) ) | addable(T) = struct { T data; List(T) *next; } *; |
---|
6 | typedef List(int) ListOfIntegers; |
---|
7 | ListOfIntegers li; |
---|
8 | int f( List(int) ((*g))(int) ); |
---|
9 | [int] h( * List(int) p ); // new declaration syntax |
---|
10 | |
---|
11 | struct(type T | addable(T) ) node { T data; struct(T) node *next; }; |
---|
12 | type List(type T) = struct(T) node *; |
---|
13 | List(int) my_list; |
---|
14 | |
---|
15 | type Complex | addable(Complex); |
---|
16 | |
---|
17 | int main() { |
---|
18 | (struct(int) node)my_list; |
---|
19 | } |
---|
20 | |
---|
21 | // Local Variables: // |
---|
22 | // tab-width: 4 // |
---|
23 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.