Changeset 3950 for to-imperative


Ignore:
Timestamp:
Sep 19, 2008, 7:50:38 PM (12 years ago)
Author:
yura
Message:
  • ParMap? with splitting of expression
File:
1 copied

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/samples/parfib2.rf

    r3945 r3950  
    1 $use Access Arithm StdIO;
     1$use Access Arithm StdIO Compare;
    22
    33$tfunc ParMap s.granule e.list = e.list;
    4 ParMap s.granule e.list, {
    5         <Left 0 s.granule e.list> :: e.head, <Middle s.granule 0 e.list> :: e.tail,
    6                 <ParMap s.granule e.tail> :: e.tail, <MapFib e.head> :: e.head,
    7                 e.head e.tail;
     4ParMap s.granule e.list, <Length e.list> :: s.length, {
     5        <Compare (s.granule) (s.length)> : '<',
     6                <Div s.length 2> :: s.halflength,
     7                <Left 0 s.halflength e.list> :: e.left,
     8                <Middle s.halflength 0 e.list> :: e.rigth,
     9                <ParMap s.granule e.left> :: e.left,
     10                <ParMap s.granule e.rigth> :: e.rigth,
     11                e.left e.rigth;
     12
    813        <MapFib e.list>;
    914};
     
    2328
    2429Main =
    25         <WriteLn <ParMap 3 21 22 23 24 25 26 27 28 29 30>>;
     30        <WriteLn <ParMap 3 22 22 22 22 22 22 22 22 22 22>>;
    2631
Note: See TracChangeset for help on using the changeset viewer.