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
1
vote
1 answer

Ride dyalog apl multiline dfn unpaired brace

]dinput · f ← { · · 1 · } f←{ SYNTAX ERROR: Unpaired brace f←{ ∧ How can I enable the ]dinput multi-line functionality by default in Ride?
1
vote
2 answers

How are APL's inner and outer product related?

In APL, one can construct a generalized inner product using f.g. According to the manual, the result is an array in which each item is constructed from the vectors of the left and right operands as f/x g¨y (x and y being the vectors taken along a…
Julius
  • 304
  • 4
  • 16
1
vote
1 answer

Simulating user interaction in Dyalog APL

I have a menu with a submenu and would like to simulate a user interaction where the user clicks on the menu and then on a submenu using ⎕NQ. However, I can only simulate one event; the subsequent ones are not handled unless I intervene by clicking…
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
1
vote
1 answer

Try/Except Syntax in APL

How to use Try/Except in APL Using :Trap is not working, Why and how to fix? Code: ∇F←R :Trap ⎕←1÷0 :Catch ⎕←'Error' :EndTrap F←0 ∇ R
Fmbalbuena
  • 95
  • 1
  • 12
1
vote
1 answer

Creating Word OLE Client from a Windows Scheduled Task causes ntdll application error

Our normal workflow is to use a Windows Scheduled Task to: convert files from rtf to pdf in bulk manipulate the pdfs to add barcodes aggregate into a single pdf then send for printing This was working fine on Windows Server 2008, but since our…
James Heslip
  • 11
  • 1
  • 3
1
vote
1 answer

How to make mutual recursion in APL?

I'm trying the following mutual recursion example in Dyalog APL Win10: even ← { (odd ⍵-1) ∨ ⍵=0 } odd ← { (even ⍵-1) ∧ ⍵>0 } even 7 WS FULL It looks like the ∨ and ∧ doesn't stop evaluation at reaching a defined state. The WS…
Miroslav Popov
  • 3,294
  • 4
  • 32
  • 55
1
vote
1 answer

Unexpected value of expression involving assignment

I saw this logic and wonder why the result is one rather than zero: P ← 1 1 0 Q ← 0 0 1 ∨/ P ∧← Q 1 On the other hand the following results in zero: P ← 1 1 0 Q ← 0 0 1 ∨/ P ← P ∧ Q 0 I'm using Dyalog APL 16.
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
1
vote
2 answers

What are the APL2 equivalents for QUAD VI, QUAD FI, and QUAD VFI?

I've been looking at APL code samples, and some of them use QUAD FI, QUAD VI and QUAD VFI. The first two are described in my textbooks (APL an interactive approach). When I try these in APL2, I get a VALUE ERROR. Is there a equivalent in APL2?
Olenka
  • 13
  • 3
1
vote
1 answer

Why does reduce operator does not work the way I expect it to?

I am trying to solve Euler 18 in Dyalog APL, and I am not able to understand why my solution does not work. The problem is as follow: By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total…
gabc
  • 23
  • 3
1
vote
1 answer

Assign singleton vector value to a single not yet defined variable in Dyalog APL

Dyalog APL allows assigning a vector of multiple values to a corresponding number of multiple not yet defined variables: x y←1 2 ]display x 1 ]display y 2 How to assign a single value from a single-element vector to a single…
Olexa
  • 577
  • 2
  • 16
1
vote
2 answers

Finding matching rows

Given two matrices A and B with the same number of columns I would like to know if there are any rows which are the same in A and B. In Dyalog APL I can use the function split like this: (↓A) ∊ ↓B Is there a way to calculate the same result without…
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
1
vote
2 answers

Is there a package manager for APL?

Is there any package manager for APL (something like cargo for Rust, npm for Node.js or pip for Python)? I'd like to contribute a package or two, but not sure how to do it other than via a GitHub repository.
Andriy Makukha
  • 7,580
  • 1
  • 38
  • 49
1
vote
2 answers

Changing caption in Dyalog APL

I'm working in Dyalog APL version 17.0 and I'm having some trouble getting a line to execute: SYNTAX ERROR switch[10] ('CP.B',(⍕zloc),'.Caption')←capt ∧ capt is a character vector, and zloc is a scalar number.…
icicle
  • 87
  • 3
1
vote
2 answers

Semantics of x,¨y in APL: ie, what does it mean to map a catenate in APL?

Consider the expression (1 2 3),¨(4 5 6). I expected this to "map the operation (1 2 3), on each of 4, 5, and 6, giving the answer as: (1 2 3),¨(4 5 6) = (1 2 3),¨((4) (5) (6)) [Using (x) = x] = (((1 2 3), 4) ((1 2 3), 5) ((1 2 3), 6)) [Using…
Siddharth Bhat
  • 823
  • 5
  • 15
1
vote
1 answer

Accessing namespace script variable

Concider the following namespace script in Dyalog APL: :Namespace Test x ← 0 ∇ F ##.Test.x ← 1 ∇ ∇ G; x x ← 0 F ∇ :EndNamespace If I run Test.G and then Test.x, I get the output zero. How…
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60