Questions tagged [gnu-apl]

11 questions
4
votes
4 answers

If-Else conditions with APL?

So, I'm wondering/asking; Is it possible to do an If-Statement in APL? If so how? Here's my code 'Please enter a number to count to: ' number ←⎕ ⍳number How do I get an if-statement to where if the user inputs a number over 100 it will…
user6471509
4
votes
2 answers

How to choose between APL compilers?

I am using Dyalog APL, but I have found that some functions are not available in gnu-apl. Are there great differences between these two APL implementations and all the other APL implementations? What is the most commonly used APL compiler?
eccstartup
  • 501
  • 8
  • 24
4
votes
1 answer

Partition behaviour in GNU APL and Dyalog APL

In Dyalog APL there is ⎕ML which changes how partition operates. When ⎕ML←0 (5 ⍴ 1 0) ⊂ 5 5 ⍴ ⍳25 ┌→─────────────────────┐ │ ┌→────┐ ┌→────┐ ┌→─┐ │ │ ↓ 1 2│ ↓ 3 4│ ↓ 5│ │ │ │ 6 7│ │ 8 9│ │10│ │ │ │11 12│ │13 14│ │15│ │ │ │16 17│ │18 19│ │20│…
alexweiner
  • 61
  • 4
2
votes
1 answer

Unrecognised symbols in GNU APL

I am playing around with GNU APL, but my experiments quickly reached an impasse. This is what happened: x←1 2 3 4 5 ⍝ build the matrix u where u_{ij} = x_i + x_j, ⍝ then filter the entries equal to 6 u←6=x∘.+x So far so good, u is a flipped…
J. D.
  • 279
  • 1
  • 9
2
votes
3 answers

APL - How can I find the longest word in a string vector?

I want to find the longest word in a string vector. Using APL I know that the shape function will return the length of a string e.g. ⍴ 'string' ⍝ returns 6 The reduce function allows me to map diadic functions along a vector but since shape is…
awyr_agored
  • 613
  • 3
  • 19
1
vote
2 answers

Is it possible to return lambdas in a function?

Consider the following function, which should return a function that adds two to any given argument: ∇r←addtwo r←{⍵+2} ∇ This code loads without any errors, but I just cannot use the return value without causing errors. addtwo ⍝ doesn't…
rajashekar
  • 3,460
  • 11
  • 27
1
vote
1 answer

Currying in GNU APL

I was trying to "curry" a function in GNU APL, however it doesn't seem to work? For example: (1∘+) 1 SYNTAX ERROR (1∘+)1 ^ ^ What am I doing wrong? Is ∘ the wrong glyph to use?
P Varga
  • 19,174
  • 12
  • 70
  • 108
1
vote
2 answers

Loading APL script from GNU APL session

In GNU APL, is there a way to load an APL script (text file) from a running APL session?
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
1
vote
2 answers

Reduce by two with named function

I'm using GNU APL. Also, I'm not really sure what the correct name for this is, but the basic idea is that I have a list of things and I want to do something with each pair. It's complex, so I've made a function for it. I notice that this works: …
Daniel Lyons
  • 22,421
  • 2
  • 50
  • 77
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
0 answers

Problems plotting with gnu-apl on OSX

I recently installed and tested gnu-apl os OSX Catalina with brew install gnu-apl It works well, I'm following the books abstract-algebra and I can do all the exercises. But when I try to plot I allways get: ⎕PLOT 0 1 ¯1 2 ¯2 3 ¯3 SYNTAX…
anquegi
  • 11,125
  • 4
  • 51
  • 67