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
2
votes
0 answers

How can I avoid a DOMAIN ERROR using matrix inversion ⌹ in Dyalog

I have been porting old APL*PLUS PC functions that run on DOS to Dyalog and have had great success. But one function runs fine on APL*PLUS PC but gave me a DOMAIN ERROR on Dyalog. I traced the problem to a matrix invertion using ⌹. Here is an…
MLS
  • 41
  • 1
2
votes
1 answer

Can Dyalog user commands be invoked from code?

My understanding is that generally one shouldn't want to do this, but my particular use case involves testing a custom user command, so being able to invoke something like ⎕SE.Foo 'mycmd my arguments' would be quite useful.
pamphlet
  • 2,054
  • 1
  • 17
  • 27
2
votes
1 answer

Make Dyalog APL Language bar bigger

How to make button size of Language bar bigger in Dyalog APL version 18.0
koly86
  • 165
  • 2
  • 11
2
votes
1 answer

How to check if the string is reshaped in APL?

How to check if the string is reshaped? Example: "aab" returns 0 because "a" can't be reshaped to this string nor any other shorter string. Another example is "aabbaab" returns 1 because "aabb" can be reshaped to this string. A lot of examples can…
Fmbalbuena
  • 95
  • 1
  • 12
2
votes
1 answer

What is the correct approach to efficiently perform a scanl in APL?

Following from my previous question, it seems that APL performs a scanl in O(n^2) but the compiler is smart enough to optimize for simple primitives. What then is the best strategy to apply \ to non-simple functions? Additionally, there are many…
mazin
  • 395
  • 2
  • 7
2
votes
1 answer

Dyalog APL - Read from .txt file

i'm new to dyalog APL and i'm struggling to read some input from an .txt file under Windows 10. The input data has the format: number name newline I want to store every line as an array element and in theory the input←⎕NGET 'input.txt' 1 function…
2
votes
1 answer

What APL expression best emulates the SQL select statement, given a matrix

I have CSV files with numeric data and I would like to perform analysis on this data. I am hoping that using APL will give me more flexibility than reading this into mysql and performing selects. But to start with I would like to do simple…
Rudi Angela
  • 1,463
  • 1
  • 12
  • 20
2
votes
2 answers

Why does an array of text lines appear to have an extra level of container?

I'm reading a file using the "array of lines" mode of Dyalog's ⎕nget: lines _ _ ← ⎕nget '/usr/share/dict/words' 1 And it appears to work: lines[1] 10th But the individual elements don't appear to be character arrays: line ←…
Mark Reed
  • 91,912
  • 16
  • 138
  • 175
2
votes
1 answer

Converting function identifier to string

If I have a vector of functions in APL, is there a way to get a vector of the function names as strings? I have tried DISPLAY and ⍕ without successs: )copy display C:\Program Files (x86)\Dyalog\Dyalog APL 16.0 Classic\ws\display.DWS sa ved Thu…
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
2
votes
2 answers

How can I extract multiple elements from a matrix in an APL tacit function?

(Dyalog) APL learner question If I have a matrix Y: Y 4 9 2 3 5 7 8 1 6 I can get two of its members like this: Y[(1 1) (2 2)] 4 5 I can use the same technique using dfn syntax: {⍵[(1 1) (2 2)]}Y 4 5 I, however, can't work…
Anthony Berent
  • 105
  • 1
  • 6
2
votes
2 answers

How do I save Dyalog APL functions in a text file?

I have the following APL Functions which I want to save in a .dyalog file: ⍝ Project Euler Solutions summul ← {+/⍵×⍳⌊1000÷⍵} euler1 ← (summul 3) + (summul 5) - (summul 15) But when I typed this code in Dyalog APL Editor, and clicked Save and…
Sohang Chopra
  • 46
  • 2
  • 4
2
votes
1 answer

Read FITS files

I have some experience in several programming languages, but I would like to try APL. I'm doing some tutorials, but I want to work in a practical example. I would like to read astronomical images from a file, in FITS format (a very common format for…
J C Gonzalez
  • 861
  • 10
  • 23
2
votes
1 answer

Choose which key is used for inputting special APL characters

I'm on Linux, and I just started using Dyalog APL. However, I would like to use the Control key instead of the Super key to input special characters. How can I do this?
Nailuj29
  • 750
  • 1
  • 10
  • 28
2
votes
2 answers

Using the each operator with the without function in APL

I have a nested array with the following data: ┌→────────────────┐ │ ┌→────┐ ┌→────┐ │ │ │ABC12│ │DEF34│ │ │ └─────┘ └─────┘ │ └∊────────────────┘ I would like to remove the numbers from each, so that it looks like this: ┌→────────────┐ │ ┌→──┐…
icicle
  • 87
  • 3
2
votes
1 answer

Finding characters in Classic Dyalog APL character set

In Dyalog APL the character vector ⎕AV contains all characters in the Classic Dyalog APL character set. Where can i find information about what each character in ⎕AV stand for? I'm trying to find out what each control character in the ASCII encoding…
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60