Calling J from Python

Diez B. Roggisch deets at nospam.web.de
Mon Feb 5 12:23:46 EST 2007


Gosi wrote:

> On Feb 5, 2:59 pm, "Diez B. Roggisch" <d... at nospam.web.de> wrote:
>> Gosi wrote:
>> > It is quite easy to call J from Python
>>
>> http://groups.google.com/group/J-Programming/browse_thread/thread/5e8...
>>
>> What is J, and why should we care?
>>
>> Diez
> 
> J is in many ways similar to Python.
> 
> J has very many advanced operations.

What exactly do you call "similar to python" when the following is a program
written in it? Compared to that, even Perl is a wonder of readability...

m    =: >@(0&{)
v    =: >@(1&{)
h    =: >@(2&{)
qu   =: >@(3&{)
z    =: i. at 0:
ret  =: |.@}:
init =: z;z;z;i.
f1m  =: (m,{. at qu);v;h;}. at qu
f5m  =: (z;(v,{:@m);h;qu,ret at m) @ (f1m^:5)
f1h  =: (z;z;(h,{:@v);(qu,ret at v)) @ (f5m^:12)
f12h =: (z;z;z;qu,ret at h,{:@h) @ (f1h^:12)
perm =: qu @ f12h @ init
ord  =: *./ @ (#&>"_) @ C.
days =: -: @ ord @ perm


http://www.jsoftware.com/jwiki/Essays/The_Ball_Clock_Problem


Diez



More information about the Python-list mailing list