Ignore:
Timestamp:
Aug 1, 2006, 9:31:01 PM (14 years ago)
Author:
orlov
Message:
  • Improved Intersperse.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/library/List/refal/List.rf

    r2037 r2044  
    8181};
    8282
    83 Intersperse (e.sep) e.list =
    84   (/*e.new-list*/) e.list $iter {
    85     e.list : t1 v2 =
    86       (e.new-list t1 e.sep) v2;
    87     (e.new-list e.list);
    88   } :: (e.new-list) e.list,
    89   e.list : /*empty*/ =
    90   e.new-list;
     83Intersperse {
     84  (e.sep) /*empty*/ = /*empty*/;
     85  (e.sep) t1 = t1;
     86  (e.sep) t1 e.list =
     87    (t1 e.sep) e.list $iter {
     88      e.list : t2 e.rest =
     89        (e.new-list t2 e.sep) e.rest;
     90    } :: (e.new-list) e.list,
     91    e.list : t2 =
     92    e.new-list t2;
     93};
    9194
    9295Nub e.expr =
Note: See TracChangeset for help on using the changeset viewer.