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

How to index a mat with 2 cols from another Mat...?

I have a namelist (text-matrix) nl43 and multiple indexes into it (in gr43) and would like to assign the elements index by the 4th and 5th columnn of gr43 to 2 variables, A and B. When accessing a single column, this would be nl43[gr43[;Column];],…
MBaas
  • 7,248
  • 6
  • 44
  • 61
2
votes
2 answers

Scan-like operations on every pair of vector's elements

I have the following vector: t ← 1 2 2 3 4 5 5 5 6 6 and would like to sum each pair of it (similar to 2+/vec, which sums every 2 adjacent elements). What is the most efficient way to do this in APL?
syntagma
  • 23,346
  • 16
  • 78
  • 134
2
votes
1 answer

Evaluation of APL direct functions

Here is a snippet I was testing recently. It takes two diameters (⍺,⍵) and computes the circumference of a circle: 10{(○1×⍺){⍺ ⍵}○1×⍵}10 ⍝ note the brackets around ⍺ 31.4159 31.4159 10{○1×⍺{⍺ ⍵}○1×⍵}10 31.4159 98.696 I would like to understand…
syntagma
  • 23,346
  • 16
  • 78
  • 134
2
votes
3 answers

Operations on nested arrays in APL

I have the data in the following structures: Nums←56 66 19 37 44 20 18 23 68 70 82 A←(⍳¨(3≤⍳4)/⍳4) ┌→────┬───────┐ │1 2 3│1 2 3 4│ └~───→┴~─────→┘ What I want to do is create another nested array that would have elements with values from Nums,…
syntagma
  • 23,346
  • 16
  • 78
  • 134
1
vote
1 answer

How can I get the last input expression in Dyalog APL?

I know I can re-execute lines by putting my text cursor on a previously entered line and pressing Enter, but sometimes the output is long and I am wondering if there is a keyboard shortcut to recall previously executed expressions to the bottom of…
RikedyP
  • 632
  • 4
  • 8
1
vote
1 answer

How can I use rich boxing when printing something in a function in Dyalog APL?

If I use quad-gets (⎕←...) to print some debugging information inside a function in Dyalog APL, it doesn't seem to respect my ]box settings. How can I print stuff with boxing on? tmp ← {⎕←⍵} ]box on -s=max ┌→────────────────┐ │Was ON…
xpqz
  • 3,617
  • 10
  • 16
1
vote
1 answer

Clearing the screen in Dyalog RIDE

Dyalog keeps a session log that persists between restarts. I find myself frequently needing to clear the screen of old output etc, and I've found no other way than mindlessly tapping on the return key. Dyalog RIDE seems to have no equivalent to the…
xpqz
  • 3,617
  • 10
  • 16
1
vote
1 answer

What conditions does ]Save in Dyalog APL have?

So I recently started learning about Dyalog APL and now I have a function that I would like to save, but when ever I try to use ]Save according to the help text provided by it I only get 'Invalid object' or 'DOMAIN ERROR' and sometimes just "Command…
Bnengon
  • 13
  • 2
1
vote
2 answers

Syntactical tree representation of an APL function (or an expression)

How to obtain a syntactical tree representation of a Dyalog APL function (or an expression)? I'd like to check whether a certain user-defined sub-function is called with certain number of elements in its right argument, explicitly specified as a…
Olexa
  • 577
  • 2
  • 16
1
vote
1 answer

(APL) About the power and circle functions

Why does *○0j1 outputs -1 but *(○0j1) doesn’t? (¯1j1e¯16) What is the difference between them? Expected *(○0j1) to output the same thing as *○0j1
d d
  • 13
  • 2
1
vote
2 answers

Porting APL*PLUS PC workspaces to Dyalog APL or GNU APL

I would like to use my old APL*PLUS PC functions on Dyalog or GNU APL. Is there a way to convert workspaces (preferred) or functions without having to retype the functions? I have tried reformatting the functions as a character matrix in APLPLUS PC…
MLS
  • 41
  • 1
1
vote
4 answers

Proper size calculation of grid tooltip

Using Dyalog APL I'm trying to create a grid with cell tooltips. These tooltips are created with the method AddComment. For some reason the tooltip does not resize itself to fit the content so if the text doesn't fit it will be cut off. Therefor a…
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
1
vote
1 answer

Blanks in path/filename for Dyalog APL ⎕NGET

I am trying to access a native file using the ⎕NGET system function on a Ubuntu Unix system. This works fine as long as the path/filename string does not contain blanks. If the path contains blanks the file is not recognized. What can I do to make…
1
vote
1 answer

Is it possible to load a user command from an in-memory namespace?

From what I can tell, user commands can only be loaded from namespace scripts located in the directories specified by the SALT cmddir setting. But I have an interest in loading a user command directly from an in-memory namespace, without ever having…
pamphlet
  • 2,054
  • 1
  • 17
  • 27
1
vote
1 answer

How to change Dyalog's UCMD source folders on Linux

On Windows the answer is Options>Configure>"User commands"
user16863939