1 UnaryOpFunctionProxy : UnaryOpFunction {
3 valueFuncProxy { arg args;
4 ^this.reduceFuncProxy(args)
6 reduceFuncProxy { arg args;
7 ^a.reduceFuncProxy(args).perform(selector)
10 ^this.reduceFuncProxy(args)
12 valueArray { arg args;
13 ^this.reduceFuncProxy(args)
17 composeUnaryOp { arg aSelector;
18 ^UnaryOpFunctionProxy.new(aSelector, this)
20 composeBinaryOp { arg aSelector, something, adverb;
21 ^BinaryOpFunctionProxy.new(aSelector, this, something, adverb);
23 reverseComposeBinaryOp { arg aSelector, something, adverb;
24 ^BinaryOpFunctionProxy.new(aSelector, something, this, adverb);
26 composeNAryOp { arg aSelector, anArgList;
27 ^NAryOpFunctionProxy.new(aSelector, this, anArgList)
30 // behave like a pattern
31 embedInStream { arg inval;
32 ^this.value.embedInStream(inval)
38 BinaryOpFunctionProxy : BinaryOpFunction {
40 valueFuncProxy { arg args;
41 ^this.reduceFuncProxy(args)
43 reduceFuncProxy { arg args;
44 ^a.reduceFuncProxy(args)
45 .perform(selector, b.reduceFuncProxy(args), adverb)
48 ^this.reduceFuncProxy(args)
50 valueArray { arg args;
51 ^this.reduceFuncProxy(args)
55 composeUnaryOp { arg aSelector;
56 ^UnaryOpFunctionProxy.new(aSelector, this)
58 composeBinaryOp { arg aSelector, something, adverb;
59 ^BinaryOpFunctionProxy.new(aSelector, this, something, adverb);
61 reverseComposeBinaryOp { arg aSelector, something, adverb;
62 ^BinaryOpFunctionProxy.new(aSelector, something, this, adverb);
64 composeNAryOp { arg aSelector, anArgList;
65 ^NAryOpFunctionProxy.new(aSelector, this, anArgList)
68 // behave like a pattern
69 embedInStream { arg inval;
70 ^this.value.embedInStream(inval)
74 NAryOpFunctionProxy : NAryOpFunction {
76 reduceFuncProxy { arg args;
77 ^a.reduceFuncProxy(args).performList(selector, arglist.collect(_.reduceFuncProxy(args)))
79 valueFuncProxy { arg args;
80 ^this.reduceFuncProxy(args)
83 ^this.reduceFuncProxy(args)
85 valueArray { arg args;
86 ^this.reduceFuncProxy(args)
90 composeUnaryOp { arg aSelector;
91 ^UnaryOpFunctionProxy.new(aSelector, this)
93 composeBinaryOp { arg aSelector, something, adverb;
94 ^BinaryOpFunctionProxy.new(aSelector, this, something, adverb);
96 reverseComposeBinaryOp { arg aSelector, something, adverb;
97 ^BinaryOpFunctionProxy.new(aSelector, something, this, adverb);
99 composeNAryOp { arg aSelector, anArgList;
100 ^NAryOpFunctionProxy.new(aSelector, this, anArgList)
103 // behave like a pattern
104 embedInStream { arg inval;
105 ^this.value.embedInStream(inval)
110 // maybe make it an abstract function object.
111 NAryValueProxy : NAryOpFunctionProxy {
112 *new { arg receiver, args;
113 ^super.new(nil, receiver, args ? [])
115 reduceFuncProxy { arg args;
116 ^a.reduceFuncProxy(arglist.collect(_.reduceFuncProxy(args)))
118 storeOn { arg stream;
119 stream << "o(" <<< a << "," <<<* arglist << ")" // is it always so?