Re: direction

new topic     » goto parent     » topic index » view thread      » older message » newer message

Here are some 'one liners' from the J dictionary. J is even more powerful
than APL and all ASCII to boot. I notice that more experienced J programmers
tend to write difficult to understand 'statements' for reasons of brevity
and bravura mostly but there is a facility to automatically parse these
wicked one liners. All this terseness is still a small price to pay for
autolooping constructs which are probably easily implemented in Euphoria
which if done even to a small and intelligent degree would probably make
Euphoria a much more enticing language to use. Anything that can not be done
with the autolooping constructs is apt to be slow however making J probably
unsuitable for game programming at this time.  www.jsoftware.com

Jay Daulton

m0=: /:~        Sort the array y in ascending order
m1=: \:~        Sort the array y in descending order
m2=: /:~"_1     Sort the items of array y ascending
d3=: /:@:{ { [  Sort indices x according to y
d4=: ]/:{"1     Sort table y according to column x
d5=: \: at [`(/: at [) @. ]   Grade x up if y is 1 and down if y is 0
d6=: \:~ at [`(/:~ at [) @. ] Sort up or down  (Try literal argument)
d7=: /:~        Sort y according to x


d0=: -:&(/:~)   Are x and y permutations of each other?
m1=: /:~-:i.@#  Is y a permutation vector?
m2=: -:-@|:     Is y antisymmetric?
m3=: -:|:       Is y symmetric?
m4=: [:+./[:*./]=/0 1"_ Are all atoms of Boolean list y equal?
m5=: *./ .= +./ Are all atoms of Boolean list y equal?
m6=: *./ .= *./ Are all atoms of Boolean list y equal?
d7=: -. at (] <:/ .>: >.@] , [)"1  Is y in the half open on the right interval
x and is it an integer?
d8=: e.         Is list x a row of array y?
m9=: *./ at (= >./\)       Are columns of y in ascending order?
m10=: *./ at (= <./\)      Are columns of y in descending order?
m11=: >./=<./   Are atoms of numerical list y equal?
m12=: *./ +. -. at (+./)   Are atoms of Boolean list y equal?
m13=: *./ = +./ Are atoms of Boolean list y equal?
m14=: *./ at (= {.)        Are atoms of list y equal?
m15=: 0:=#|+/   Are atoms of Boolean list y equal?
m16=: *./ at (#1&|.)       Are atoms of Boolean list y equal?
m17=: ([:,:0:,#)-: v19"_ rxmatch ]      Is y a legal J name?
d18=: rxmatch=: 17!:0   '' to get rxmatch
v19=: '[[:alpha:]][[:alnum:]_]* '"_     'regex' to get alpha: and alnum:

-----Original Message-----
From: Everett Williams [mailto:rett at GVTC.COM]
Sent: Tuesday, March 21, 2000 9:44 PM
To: EUPHORIA at LISTSERV.MUOHIO.EDU
Subject: Re: direction


Jeff Zeitlin wrote:

>On Tue, 21 Mar 2000 00:00:45 -0500, bfurniss
><bfurniss at IHUG.CO.NZ> wrote:
>
>>    What exactly is the J language ?   Java  ?
>
>No, for all intents and purposes, it's APL with keywords instead
>of hieroglyphics.
>
Now, I wouldn't sneer at that idea. One of my old IBM buddies worked with
the author of APL and was very good with it. He said, and I believe him,
that APL could produce some of the most compact code in the world. He
also called it a write-only language. He said that there were some perfectly
good, working programs that  neither he nor anybody else that he knew had
been able to figure out and they consisted of only one line of code.

So APL without the hieroglyphics might be a quite wonderful language, but
not at that price.

Everett L.(Rett) Williams
rett at gvtc.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu