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
4
votes
1 answer

APL: array's element replacement and multiplication

Let's say in APL language, I have a 2D array of shape 10x3. I cannot figure it out how to: replace all the occurrence of some specific numbers (e.g. 1, 2, 3, 4) in the entire array with 0, 10, 100, 1000 respectively. So I want to map 1 to 0, 2 to…
4
votes
1 answer

How do I convert a vector of triplets to a 3xnx3 matrix in Dyalog APL?

I have a vector containing 9000 integer elements, where each group of 9 has 3 sub-groups that I'd like to separate out, resulting in a matrix with the shape 3 1000 3. Here's what I did: ⎕IO←0 m←(9÷⍨≢data) 9⍴data a←m[;0 1 2] b←m[;3 4 5] c←m[;6 7…
xpqz
  • 3,617
  • 10
  • 16
4
votes
2 answers

Dyalog APL: how to write standalone files that can be executed?

I now know how to use the APL interpreter, but I'm quite confused about how to write APL into a file and then run the said file. I currently write Dyalog APL using the ride IDE. What I now want to do is to: Use the ride IDE to develop programs (how…
4
votes
4 answers

Parallel sessions in Dyalog APL

At least one of the single-letter languages (certainly q) has a facility for interprocess communication, a kind of parallel execution of longer-running processes on multiple computers. These sessions could be on the same computer or on a server on…
Lurgid Bee
  • 63
  • 7
4
votes
1 answer

Problems when trying to use arrays in APL. What have I missed?

I obviously have missed some things about how to extract elements from arrays in APL and hope that someone can see what I have missed and how I should do to get the expected results in a way that I can reproduce in a meaningful way. I am relatively…
Harley
  • 83
  • 7
4
votes
2 answers

Dyalog APL - Disabling APL symbol input

I recently obtained a personal licence for Dyalog APL and started using it (I'm switching over from APLX). I really like it, but whenever I'm not using the IDE, the APL symbol keybindings persist. For example, if I try to undo something in another…
ren
  • 270
  • 2
  • 15
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
4
votes
3 answers

Dividing character vector into segments

I have the following vector Vec: ACGTTGCA and would like to divide it into a nested vector, in which on the i-ith positions there will be a subsegment of Vec of length 4, starting at the i-th position of Vec. For example, Vec[(⍳¯3+⍴Vec)∘.+¯1+⍳4]…
syntagma
  • 23,346
  • 16
  • 78
  • 134
3
votes
1 answer

In Dyalog APL, can an Reduce N-Wise be a function or is it just an expression?

Say I want to name a function (assign to a variable) that does n-wise (2 in this example) reduction. Using tryapl.org it looks like I can't: v←⍳5 2,/v ┌───┬───┬───┬───┐ │1 2│2 3│3 4│4 5│ └───┴───┴───┴───┘ 2,/ SYNTAX ERROR: Missing…
justin2004
  • 75
  • 5
3
votes
2 answers

DYALOG APL, Connect to SQL Server using .NET and load a DataTable with data using SqlConnection

DYALOG APL, Connect to MS SQL Server using .NET and load a DataTable with data using SqlConnection. I do not want to use SQAPL. I want to use DataTable as they can be used as data sources to GUI components, and want to use DataTable methods and…
Mike Chris
  • 89
  • 6
3
votes
1 answer

Can someone explain this behavior for finding parent/child relationships of unnamed Namespaces?

I'm trying to use ## to find the parent of a namespace, and then ⎕NL -9 to find its children. Suppose I have a parent namespace: 'parent' ⎕NS '' Now I have 2 child namespaces: One named, and one unnamed: 'namedChild' parent.⎕NS '' unnamedChild ←…
Josh D
  • 33
  • 1
  • 3
3
votes
1 answer

How to get column names with Dyalog APL after an SQL query?

I am working with Dyalog APL and having trouble with getting the column names of a table resulted from an SQL query. More precisely, I am working with the workspaces (WS) sqapl and LOADDATA provided by Dyalog. Although the functions LoadSQL and…
T.P.
  • 133
  • 5
3
votes
1 answer

How do I POST raw data in Dyalog APL HttpCommand?

I am trying to submit data as plain text using HttpCommand object. I know how to do it with cURL, but I'm unsure how to specify the data in my HttpCommand object. Here's how I would do it with cURL: curl -request POST "http://my-api-url" --header…
RikedyP
  • 632
  • 4
  • 8
3
votes
1 answer

Get the day(s) with the highest temperature from a table

I'm trying to get the highest temperature day(s) in APL. This is my code: days ← 'Monday' 'Tuesday' 'Wednesday' 'Thursday' 'Friday' 'Saturday' 'Sunday' temp ← 7 1 1 ⍴78 80 89 82 79 89 73 Centigrade ← (5÷9) × {(⍵ - 32)} …
bRaNdOn
  • 1,060
  • 4
  • 17
  • 37
1
2
3
9 10