Changeset 36ebd03 for src/examples/it_out.c
- Timestamp:
- Mar 3, 2016, 1:28:56 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 3627356
- Parents:
- 9d7b3ea (diff), 4040425 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/it_out.c
r9d7b3ea r36ebd03 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Ma y 27 18:41:23 201513 // Update Count : 412 // Last Modified On : Wed Mar 2 18:11:00 2016 13 // Update Count : 5 14 14 // 15 15 16 16 typedef unsigned long streamsize_type; 17 17 18 context ostream( dtype os_type ) {18 trait ostream( dtype os_type ) { 19 19 os_type *write( os_type *, const char *, streamsize_type ); 20 20 int fail( os_type * ); 21 21 }; 22 22 23 context writeable( type T ) {23 trait writeable( type T ) { 24 24 forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, T ); 25 25 }; … … 29 29 forall( dtype os_type | ostream( os_type ) ) os_type * ?<<?( os_type *, const char * ); 30 30 31 context istream( dtype is_type ) {31 trait istream( dtype is_type ) { 32 32 is_type *read( is_type *, char *, streamsize_type ); 33 33 is_type *unread( is_type *, char ); … … 36 36 }; 37 37 38 context readable( type T ) {38 trait readable( type T ) { 39 39 forall( dtype is_type | istream( is_type ) ) is_type * ?<<?( is_type *, T ); 40 40 }; … … 43 43 forall( dtype is_type | istream( is_type ) ) is_type * ?>>?( is_type *, int* ); 44 44 45 context iterator( type iterator_type, type elt_type ) {45 trait iterator( type iterator_type, type elt_type ) { 46 46 iterator_type ?++( iterator_type* ); 47 47 iterator_type ++?( iterator_type* );
Note:
See TracChangeset
for help on using the changeset viewer.