Changes in / [bbc9b64:a357b4c]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/generic_types.tex

    rbbc9b64 ra357b4c  
    222222Hence, programmers can easily form new local environments to maximize reuse of existing functions and types.
    223223
    224 Finally, \CFA allows variable overloading:
     224Finally, variables may be overloaded:
    225225\lstDeleteShortInline@
    226226\par\smallskip
     
    271271forall( otype T | summable( T ) )
    272272  T sum( T a[$\,$], size_t size ) {
    273         `T` total = { `0` };                                    $\C{// instantiate T from 0}$
     273        T total = { 0 };                                                $\C{// instantiate T from 0}$
    274274        for ( unsigned int i = 0; i < size; i += 1 )
    275                 total `+=` a[i];                                        $\C{// select appropriate +}$
     275                total += a[i];                                          $\C{// select appropriate +}$
    276276        return total;
    277277}
Note: See TracChangeset for help on using the changeset viewer.