apl

APL versus A versus J versus K?

百般思念 提交于 2019-12-03 00:29:17
问题 The array-language landscape, while fascinating, is confusing to no end. Is there a reason to pick one of J or K or APL or A? None of these options seem to be open-sourced -- are there open sourced versions? I would love the expand my mind, but I remain befuddled. 回答1: The differences among these languages are relatively subtle. APL "proper" has the advantages, and disadvantages, of the original symbolic notation. (There are minor changes that have been made to the symbol set over the years,

APL versus A versus J versus K?

馋奶兔 提交于 2019-12-02 14:06:11
The array-language landscape, while fascinating, is confusing to no end. Is there a reason to pick one of J or K or APL or A? None of these options seem to be open-sourced -- are there open sourced versions? I would love the expand my mind, but I remain befuddled. kaleidic The differences among these languages are relatively subtle. APL "proper" has the advantages, and disadvantages, of the original symbolic notation. (There are minor changes that have been made to the symbol set over the years, but they're all true enough to the original vision.) The A+ language is available open source. It

Ascending Cardinal Numbers in APL

那年仲夏 提交于 2019-12-02 11:32:15
In the FinnAPL Idiom Library, the 19th item is described as “Ascending cardinal numbers (ranking, all different) ,” and the code is as follows: ⍋⍋X I also found a book review of the same library by R. Peschi, in which he said, “'Ascending cardinal numbers (ranking, all different)' How many of us understand why grading the result of Grade Up has that effect?” That's my question too. I searched extensively on the internet and came up with zilch. Ascending Cardinal Numbers For the sake of shorthand, I'll call that little code snippet “rank.” It becomes evident what is happening with rank when you

The most idiomatic way of creating identity matrix in APL

≡放荡痞女 提交于 2019-12-01 22:30:49
问题 According to Rosetta Code, there are two idiomatic ways of creating identity matrix in APL: 1. ID←{∘.=/⍳¨ ⍵ ⍵} 2. ID←{⍵ ⍵ ρ 1, ⍵ρ0} How does the (2) work? Why is this better than the (1), which uses Outer Product that is considered idiomatic approach in APL? 回答1: If you compare the performance of the two expressions, 2 clearly wins: cmpx'{∘.=/⍳¨ ⍵ ⍵}1000' '{⍵ ⍵ ⍴ 1, ⍵⍴0}1000' {∘.=/⍳¨ ⍵ ⍵}1000 → 2.4E¯3 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕ * {⍵ ⍵ ⍴ 1, ⍵⍴0}1000 → 5.7E¯5 | -98% ⎕ If you

Ascending Cardinal Numbers in APL

一世执手 提交于 2019-12-01 10:57:14
问题 In the FinnAPL Idiom Library, the 19th item is described as “Ascending cardinal numbers (ranking, all different) ,” and the code is as follows: ⍋⍋X I also found a book review of the same library by R. Peschi, in which he said, “'Ascending cardinal numbers (ranking, all different)' How many of us understand why grading the result of Grade Up has that effect?” That's my question too. I searched extensively on the internet and came up with zilch. 回答1: Ascending Cardinal Numbers For the sake of