source: to-imperative/trunk/samples/Apply/apply2.rf @ 2049

Last change on this file since 2049 was 1144, checked in by orlov, 17 years ago
  • Example of reference to function with format other than e = e.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 420 bytes
Line 
1$use Apply Arithm StdIO;
2
3
4$func Map s.Fname e.Fargs (e.list) = e.new-list;
5
6Map s.Fname e.Fargs (e.list) =
7  () e.list $iter {
8    e.list : t.item e.rest =
9      (e.new-list <Apply s.Fname e.Fargs t.item>) e.rest;
10  } :: (e.new-list) e.list,
11  e.list : /*empty*/ =
12  e.new-list;
13
14
15$func Div? s.n s.k = e.maybe-k;
16
17Div? s.n s.k, {
18  <Rem s.k s.n> : 0 = s.k;;
19};
20
21
22Main = <WriteLN <Map &Div? 3 (1 2 3 4 5 6 7 8 9 10)>>;
23
Note: See TracBrowser for help on using the repository browser.