Questions tagged [apl]

APL (named after the book A Programming Language) is an interactive array-oriented language. It is based on a mathematical notation developed by Kenneth E. Iverson. Do not use this tag for Alexa Presentation Language; use [alexa-presentation-language] instead.

Wiki

APL, short for A Programming Language, is an interactive array-oriented language and integrated development environment. It is an interpreted language with built-in array capabilities and outstanding debugging features that makes the language a perfect choice for the agile approach. APL is also the first functional programming language ever, and it is also considered as a tacit programming language.

Example

APL uses symbols, array comprehension, and implied Iverson brackets to make its code concise and enable thinking about it much like Mathematical formulas.

This example assigns the vector (list) value 4 5 6 7 to N:

N ← 4 5 6 7 

The code below then adds 4 to all elements of the vector (giving 8 9 10 11):

N + 4

Now we can get a Boolean mask indicating results of 10 or higher (giving 0 0 1 1):

10 ≤ N + 4

And sum that to find out how many sums fulfilled the criteria (giving 2):

+/ 10 ≤ N + 4

Tag usage

The tag should be used for programming related problems in implementing or using the APL programming language. Please avoid theoretical and conceptual questions on Stack Overflow. Other tags such as , or can also be used with tag . Make sure to specify which dialect you use, for example by using the tag.

Read more

341 questions
0
votes
2 answers

Compressing Rather Large Table in APL

I am currently working on finding a palindrome of made from multiplying numbers of length 3 together (from 900 to 1000). I am able to generate a table of palindromes in binary (1/0). However, the compress function (/) is giving me an error regarding…
ArbIn
  • 43
  • 5
0
votes
1 answer

APL. How to find palindrome numbers in a given product list

The particular question asks to find all palindrome numbers between 900 and 1000. new_set ← (900 + ⍳100) 901, 902, 903, 904, ..., 999, 1000 ⍕¨(new_set ∘.× new_set) {⍵≡⌽⍵} ⍕¨(new_set ∘.× new_set) The first line creates the new set of numbers. The…
ArbIn
  • 43
  • 5
0
votes
2 answers

Specifying Non-Absolute Paths to Libraries in GNU APL

I want to be able to use the same config file across all of my machines, and my username is unfortunately different at work, so absolute paths are difficult for me to use. Is there a common way to specify non-absolute directories for LIBREF-*…
0
votes
1 answer

Idiomatic graphs in APL

APL is great for array type problems but I'm curious as to how best work with graphs in APL. I'm playing around with leet questions, for example question 662. Maximum Width of Binary Tree, the exercise works with Node objects with a value/left/right…
mazin
  • 395
  • 2
  • 7
0
votes
2 answers

Even Fibonacci numbers Sum

Even Fibonacci numbers sum whose values do not exceed four million. I am using multiline function in APL, but not getting the output: result←Euler2 a;b;c;sum;i;limit b←0 c←1 sum←0 i←0 limit←4000000 :For i :In limit a←b b←c …
Pk1
  • 3
  • 1
0
votes
3 answers

Add APL Keyboard Layout On Linux 20.04

I would like to start coding in the APL programming language. But for that, I need the right keyboard layout! Here is the list of behaviors I'm looking for: can be used with other layouts (us, fr...) layout is swapable with the normal shortcut…
RilDev
  • 101
  • 1
  • 8
0
votes
1 answer

How does inner product generalize to higher-dimensional arrays?

How does the APL-style inner product operator (higher-order function), which accepts two function arguments and two arrays, generalize to more than two dimensions? I see that the result array has a number of dimensions equal to the sum of the…
John Cowan
  • 1,497
  • 12
  • 13
0
votes
2 answers

Preserving large numbers when converting to characters in APL

I have the following number in APL 1200000002341 When I do the following k←1200000002341 k←⍕k The value of k becomes 1.2E12. How do I preserve the intricacies of the number when converting to character form?
0
votes
1 answer

APL How many integers

How many integer numbers are in the vector 20.88 10 ¯2.3 0 .555 222 ¯0 2 3.3 9? I need to do it using APL. Please also recommend any links to learn the APL language.
Artyr
  • 21
  • 2
0
votes
2 answers

Syntax error when attempting to amend a string with indexing

I'm studying APL from here. Why am I getting this syntax error? 'computer' [ 1 2 3 ] ← 'COM' SYNTAX ERROR 'computer'[1 2 3]←'COM' ^ But if I save 'computer' in a variable I don't get the error: T ← 'computer' T computer …
zeynel
  • 177
  • 1
  • 1
  • 12
0
votes
2 answers

Waiting between GUI events

I'm trying to write a test for a graphical component in Dyalog APL which will simulate button clicks which open new windows and keystrokes for filling in form fields. My first approach was to simply write a sequence of ⎕NQ statements for enqueuing…
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
0
votes
0 answers

Extract Particular Word and Geo-code it

I have two dataframes with two columns each event: column names --> "District" "City" villages: column names --> "District" "Village" "event" dataframe has district names and events happening in its district villages. The "City" column is a…
Adarsha Murthy
  • 145
  • 3
  • 13
0
votes
1 answer

quad DR domain error

Under what circumstances could ⎕DR intermittently fail? While it's been running fine for years, our system which reads binary data from a file recently from time to time has been crashing with a DOMAIN ERROR at ⎕DR. The application code in question…
0
votes
2 answers

a←b←⍳1000⋄ a-⊂b ⍝This takes forever, are there alternatives? (gnuapl)

I'm running gnuapl 1.5 with the experimental parallel features enabled. Running the following two lines across four cores: a←b←⍳x←1000 a-⊂b ⍝This line seems to take a very long time to compute. For smaller values of x (such as ten and one hundred),…
alexweiner
  • 61
  • 4
0
votes
2 answers

APLX: Order a mixed data matrix by second column

I'm working in APLX, and I need to order a two column matrix (it will always be two columns) by the second column. This issue being, the first column contains rows of 7 alphanumeric character sets. The second column, however, contains a weight or…
Susannah Potts
  • 837
  • 1
  • 12
  • 32
1 2 3
22
23