Questions tagged [dyalog]

"Dyalog" refers to the APL implementation developed and distributed by British company Dyalog Ltd. Dyalog APL includes many additions over the ISO standard for APL. This tag should be used in addition to [apl] when asking for help with language features specific to Dyalog APL, or when a solution using such features is acceptable.

Dyalog APL, or simply Dyalog, is a nested APL by British company Dyalog Ltd. The name Dyalog is a portmanteau of Dyadic and Zilog since it was initially released for the Zilog Z8000 processor in 1983. Continuously developed since, Dyalog has added numerous core language features, and support for many programming paradigms including object-oriented programming based on .NET, Lisp-style lexically scoped anonymous functions (dfns), and leading axis and tacit programming support based on J. It supports several platforms and interoperability between them, and interfaces with other languages and runtimes including native shared libraries, .NET, the JVM, R, and Python.

Example

This defines m as a 4-row, 3-column matrix consisting of the first 12 natural numbers:

      m ← 4 3 ⍴ ⍳ 12

Now we can sum the columns:

      +⌿ m
22 26 30

Counting the number of rows:

      ≢ m
3

Average of each column using an anonymous tacit function:

      ( +⌿ ÷ ≢ ) m
5.5 6.5 7.5

Tag usage

This tag should be used together with (in addition to more subject-specific tags) when asking about features limited to Dyalog APL and similar dialects, or when asking for code to complete a task, and a solution using Dyalog features is acceptable. Due to the rapid development of the language, it is beneficial to also include which version number is used, e.g. 17.1 or 18.0.

Learn more

146 questions
3
votes
1 answer

How to use rank operator instead of each in APL

I have dummytxt←'abcdefghijk' texttoadd←'down' rfikv←20 30 50 and need following output defghijk20down defghijk30down defghijk50down I can do it with: scenv←(¯10↑¨(⊂dummytxt),¨⍕¨rfikv),¨⊂texttoadd but please help me to write without each…
3
votes
1 answer

Arrays in J: indexing from one into another

Using J I am trying to do something similar to the following example shown on page 128 of Mastering Dyalog APL by Bernard Legrand (2009). I have not been able to find a direct conversion of this code into J, which is what I want. Here's the…
Jamie
  • 150
  • 6
3
votes
3 answers

How can I format a number vector and a string vector? (Dyalog APL)

I've been studying APL only a few weeks but I really like it. I tried to write simple functions to practice what I learn. This one tells me how much money I'm left with next 13 months if I withdraw W every month from initial capital of T. R←T Money…
zeynel
  • 177
  • 1
  • 1
  • 12
3
votes
4 answers

FInd location of element in a vector

I'm new to APL and I would like to find the position of an element(s) within a vector. For example, if I create a vector of 50 random numbers: lst ← 50 ? 100 How can I find the positions of 91 assuming it occurs 3 times in the vector? Thanks.
awyr_agored
  • 613
  • 3
  • 19
3
votes
2 answers

What does this APL code do?

I am trying to learn APL. Following code snippet is from http://archive.vector.org.uk/art10011550 where it is stated that this code is as simple as reading 'MUMMY' in English! R←((V⍳V)=⍳⍴V)/V I have tried to check from…
rnso
  • 23,686
  • 25
  • 112
  • 234
3
votes
2 answers

APL Component Files vs. Native Files vs. Databases

I'm new to APL and am starting to work on an APL code base which uses APL Component Files (e.g. ⎕FSTIE, ⎕FREAD, ⎕FAPPEND) heavily. I have also been asked to research transfering the contents of these component files to an SQL database, the point of…
Apollo 42
  • 95
  • 6
3
votes
2 answers

Redirection of standard input seems to change behaviour of Dyalog APL program (when calling mapl using symbolic link named dyalog)

I am trying to learn APL (both APL in general and Dyalog APL, which seems to be actively under development and in use here in Stockholm). When doing so, I have observed, in my Ubuntu Linux environment, that dyalog (in fact a file called mapl, which…
Harley
  • 83
  • 7
3
votes
1 answer

Performance of string operations in Dyalog

I have 2 questions related to comparing character vectors in Dyalog APL. The following code will compare character vectors one-by-one: a←'ATCG' b←'GTCA' a=b In order to speed up (in case of 2 vectors, as well as in case of comparing many vectors…
syntagma
  • 23,346
  • 16
  • 78
  • 134
2
votes
3 answers

How to increase variable precision in Dyalog APL?

I need to work with precision in Dyalog APL. I know the value of ⎕PP sets the precision, but I can't increase it over 18, so I can't get more precision than 18 digits and I need to operate with big numbers. Is there any way to increase precision?
Fernando Martin
  • 512
  • 1
  • 6
  • 21
2
votes
1 answer

Running a custom hook after fixing a function

Using Dyalog APL 16, is it possible to define a function which is called directly after a function is fixed (with Ctrl+Down)?
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
2
votes
2 answers

How provide default values when using ⌸ in Dyalog APL

When using key ⌸ to produce a frequency table, e.g {⍺,≢⍵}⌸'mississippi' ┌→──┐ ↓m 1│ │i 4│ │s 4│ │p 2│ └+──┘ I frequently find myself wanting to 'seed' the result set to provide a count of 0 for any items I know to be missing. If we're doing a…
xpqz
  • 3,617
  • 10
  • 16
2
votes
1 answer

Access same row/column in each array in nested arrays in Dyalog APL

Is there a way to multiply or add a scalar to the same row or column in each array of a nested array without a loop? For example I would like to multiply all the values in the 2nd column (or row) of each array by 2 for the sample nested array…
xpqz
  • 3,617
  • 10
  • 16
2
votes
2 answers

Resuming execution after conditional breakpoint in Dyalog APL

In a previous question I asked about how to set a conditional breakpoint in Dyalog RIDE, and the accepted answer works as advertised, by creating a guard statement with an empty function call as the body. Execution will be halted on the expected…
xpqz
  • 3,617
  • 10
  • 16
2
votes
1 answer

Setting a conditional breakpoint in Dyalog RIDE

In Dyalog RIDE, I know how to set breakpoints that will halt execution on specific lines in the APL source. Is there a way to make a breakpoint conditional so I can stop at a line only if a particular set of conditions are met, e.g. 0<+⌿⍵?
xpqz
  • 3,617
  • 10
  • 16
2
votes
1 answer

Where is Dyalog installed on Windows?

Some documents refer to things in the Dyalog installation directory. How can I easily find out where that directory is? I searched the internet and found the SETUP README for version 18.2, which shows the non-Administrator install directory, but I…
RikedyP
  • 632
  • 4
  • 8