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 do I tell a running Dyalog session to accept RIDE connections?

Dyalog RIDE can connect to running interpreter sessions, but in order for that to work, is there a way to tell an already running session that it should start listening to incoming connections? I know I can start a new session with the following…
xpqz
  • 3,617
  • 10
  • 16
3
votes
1 answer

Two APL functions give different results, but their boxing is identical

I am trying to create an APL function which returns differences (non-identical items with identical index) between two vectors. I have come up with the following and it works fine, subtracting two vectors and discarding zeroes from the result: func…
kamilok04
  • 33
  • 5
3
votes
1 answer

Most efficiently insert a number in a maintained large sorted variable

I need to most efficiently insert a number in a maintained large sorted variable. Is there a better method than test1? test1 is quite a bit faster vs test2 which is just to append a variable then resort. q←1000000⍴0 ⋄ q←10 9 8 7 6 5 4 3 2,q …
creatural
  • 31
  • 4
3
votes
2 answers

How to change the font in RIDE for Dyalog APL?

There are many APL Fonts I am interested in using with the Remote IDE for Dyalog APL. How do I change the font in RIDE?
eitanlees
  • 1,244
  • 10
  • 14
3
votes
1 answer

How can I label connected components in APL?

I'm trying to do leet puzzle https://leetcode.com/problems/max-area-of-island/, requiring labelling connected (by sides, not corners) components. How can I transform something like 0 0 1 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 1 0 0 1 into 0 0 1 0 0 0…
mazin
  • 395
  • 2
  • 7
3
votes
1 answer

What is the space-time complexity of the scan operator in APL?

Typically scan, both left and right variants, are O(n) in both space and time. However it seems that APL's \ operator is like scanl but seems to behave differently in that it is right associative and runs over the array each time, making it…
mazin
  • 395
  • 2
  • 7
3
votes
1 answer

Dyalog APL - Towers of Hanoi - does not loop properly

I cannot make it work in Dyalog APL solve←{ n a c b←⍵ n≤0:⍬ solve(n-1)a b c ⎕←'Move disk from' a 'to' c solve(n-1)b c a } solve 4 'A' 'C' 'B' It loops from the first solve (n-1) a b c but never goes to line 4. The same…
Miroslav Popov
  • 3,294
  • 4
  • 32
  • 55
3
votes
1 answer

SYNTAX ERROR (change nameclass on assignment) in APL

When I try to assign to a name in Dyalog APL, I get one of these error messages: SYNTAX ERROR: Can't change nameclass on assignment SYNTAX ERROR: Invalid modified assignment, or an attempt was made to change nameclass on assignment What exactly…
Adám
  • 6,573
  • 20
  • 37
3
votes
1 answer

In APL how to turn a string into a one cell vector

So, I have a function f that takes a string as input. I want to create a function g that maps f to a vector of strings. I.e. g 'Hello' 'world' should yield (f 'Hello')(f 'world') Here's what I did: g ← {f¨⍵} And this works just fine for the…
3
votes
1 answer

Dyalog SALT.Load exceptions "could not fix" for raw function trains

I've been experimenting with SALT but am encountering consistent Load problems that seem to only affect raw function-trains. I hoped for any advice on ensuring all functions Load correctly. To illustrate, in a clear workspace I'll create some…
alexgibbs
  • 2,430
  • 2
  • 16
  • 18
3
votes
1 answer

How to manipulate multiple nested arrays in Dyalog APL?

I have been given matrices filled with alphanumerical values excluding lower case letters like so: XX11X1X XX88X8X Y000YYY ZZZZ789 ABABABC and have been tasked with counting the repetitions in each row and then tallying up a score depending on the…
JTP
  • 85
  • 4
3
votes
1 answer

Dyalog APL hijack Windows Key and do not give it back (Fedora 32/Gnome, Free Licence, Kitty)

When launching Dyalog, it will directly map the Windows Key as the APL Symbol key. However when I leave Dyalog with ⎕OFF, it will not return in the normal state of the keyboard. Most of my WM keybinding involves the Win key and I did not find any…
3
votes
1 answer

How to access the standard output stream (stdout) from Dyalog APL

There are some possibilities to utilize standard output (stdout) by Dyalog APL language?
Pavlo
  • 61
  • 5
3
votes
3 answers

Creating a textual copy of the apl language bar

I would like to embed a picture of the Dyalog APL language bar into text and PowerPoint material. How can I do that? It would be nice to be able to select and paste it.
Ray
  • 31
  • 1
3
votes
2 answers

How to build own Each operator using Rank operator in Dyalog APL

I saw answer in this question How to use rank operator instead of each in APL how to build own Each operator using Rank ⍤. Monadic Each f¨x can be represented as {⊂f⊃⍵}⍤0⊢x Dyadic Each x f¨y can be represented as x{⊂(⊃⍺)f(⊃⍵)}⍤0⊢y In terms of this…
1 2
3
9 10