问问题
96 次
2 回答
3
于 2019-10-09T08:18:29.727 回答
1
这是相同的组合运算符,形式更详细,带有注释:
Each←{ ⍝ Monadic operator; ⍺⍺ is the operand function
⍺←⊢ ⍝ If called monadically ⍺ won't do anything (it will be the no-op function)
Apply←{ ⍝ This operator applies its operand function (⍺⍺) to disclosed argument(s)
⍝ and encloses the result
×⎕NC'⍺': ⊂ (⊃⍺) ⍺⍺ (⊃⍵) ⍝ if we have a left argument, apply ⍺⍺ dyadically (enclose both)
⊂ ⍺⍺ (⊃⍵) ⍝ otherwise, apply ⍺⍺ just on the enclosed ⍵
}
⍝ Now we're ready to apply to separate elements:
⍺ ( (⍺⍺ Apply)⍤0 ) ⍵ ⍝ Even though we have ⍺ here, it may be ⊢ causes a monadic call to ⍺⍺
}
于 2019-10-09T20:34:12.933 回答