1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 """C{f FUNCTION}
19
20 The result obtained by applying C{FUNCTION} to an input sequence is
21 written as output.
22
23 B{Example}: If input contains the sequences C{(1, 2), (3, 4), (5, 6)}
24 then this command::
25
26 f 'x, y: x + y'
27
28 generates the output C{(3,), (7,), (11,)}.
29 """
30
31 import types
32
33 import osh.function
34 import osh.core
35
36
39
40
42 """The result obtained by applying C{FUNCTION} to an input sequence is
43 written as output.
44 """
45 return _F().process_args(function)
46
47
48
49
50 -class _F(osh.core.Generator):
51
52 _function = None
53
54
55
56
59
60
61
62
65
67 args = self.args()
68 self._function = args.next_function()
69 if self._function is None or args.has_next():
70 self.usage()
71
73
74 self.send(self._function(*object))
75
76
77
78
80 self.send(self._function())
81