Dyalog APL will have forks in the next version, an occasion which led me to
make up a list of evocative forks ("trainspotting"). Some selections from
this list, transcribed back into J from APL:
>./ - <./ range
+,-,*,% “function vector”
_10&< *. <&10 open interval; numbers between _10 and 10
_10&<: *. <:&10 closed interval
1 = *:@(1&o.) + *:@(2&o.) Pythagorean theorem for the unit circle
f=: i. +/ .! |.@i. Try f"0 i.12
bc=: 1&, + ,&1 next set of binomial coefficients; e.g. bc^:(i.12) 1 .
See Figure 1 of Falkoff and Iverson, *The
APL\360 Terminal System
<http://www.jsoftware.com/papers/APL360TerminalSystem.htm>*, 1967.
m|^ called “powermod” in Mathematica
1 i.~ c also 0 i.~ c, for c one of < <: = ~: >: >
(0.5 * ] + %)^:_~ square root by Newton iteration
On Wed, Jan 15, 2014 at 8:44 PM, Roger Hui <[email protected]>wrote:
> http://keiapl.org/anec/#nvv
>
> sin=: 1 o. ]
> cos=: 2 o. ]
> (^@j. = cos + 0j1 * sin) 1 2 3 0.1j_0.2
> 1 1 1 1
>
> (^@j. = cos j. sin) 1 2 3 0.1j_0.2
> 1 1 1 1
>
> The insight that led to the invention of the j. function illustrates what
> separate genius from mere mortals. Who would think of inventing a function
> whose monad is 0j1*y and whose dyad is x+0j1*y? Too simple.
>
> The above equation is Euler's formula, a special case of which is Euler's
> identity, 0 = 1 + ^ 1p1 * 0j1, the most beautiful equation in all of
> mathematics. Concerning Euler's identity, let me share with you something
> I came across recently:
>
> e raised to the pi times i,
> And plus 1 leaves you nought but a sigh,
> This fact amazed Euler,
> That genius toiler,
> And still gives us pause, bye the bye.
>
> —— John Scholes, http://dfns.dyalog.com/n_Euler.htm
>
>
>
>
>
>
> On Wed, Jan 15, 2014 at 8:03 PM, Raul Miller <[email protected]>wrote:
>
>> I think we some simple, evocative fork examples which are not mean.
>>
>> One possibility is fahrenheit to centigrade conversion:
>>
>> (5r9 * -&32)
>>
>> Another might be area of a circle with the given radius:
>>
>> (2 * o.)
>>
>> What might some others be? Perhaps a dyadic use of fork could be both
>> simple to express and easy to think of as useful?
>>
>> Thanks,
>>
>> --
>> Raul
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm