Currying favor
&
(bond)
A dyad may be supplied with a fixed left or right argument to provide a useful monad, by using the bond conjunction, denoted by the ampersand (&), together with a dyad as left or right argument, and some value as the other argument. For example, a “three times” verb may be defined thrice=.3&* thrice 2 _1.7 0 6 _5.1 0 Another example provides a “rotate left 1” verb by fixing the left argument of the rotate verb (|.) to be 1 rotleft1=.1&|. rotleft1 'star' tars The common logarithm verb may be defined by log=.10&^. log 2 3 0.30103 0.477121 And the sine in degress of high school trigonometry by (1) radians from degrees rfd =. *&0.0174532925199432958 rfd 30 45 60 0.523599 0.785398 1.0472 (2) sine of radians sin=.1&o. (3) sine of degrees sind=.sin@rfd sind 30 45 60 0.5 0.707107 0.866025 |