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.

Filter by
Sorted by
Tagged with
2 votes
1 answer
47 views

Is Execute unsafe in namespece paths?

I'm handling a json string converted into a namespace. Here's a toy example to illustrate my concern: What if a malicious client POSTed this payload? js←'{"foo": "bar", "⎕OFF&...
mappo's user avatar
  • 466
1 vote
1 answer
85 views

APL2-style inner product in Dyalog APL

Consider this Boolean matrix which indicates, for each of 7 products, which of the 5 resources are needed: ⎕←cross←7 5⍴1 1,(4/0),1 0 1 0 1,(6/0),1 0 1 0 1 0 0 1 0 0 1 1 0 0,(3/1),0 1 1 0 0 0 0 1 ...
Adám's user avatar
  • 6,593
2 votes
1 answer
28 views

Running a custom hook after fixing a function

Using Dyalog APL 16, is it possible to define a function which is called directly after a function is fixed (with Ctrl+Down)?
August Karlstrom's user avatar
3 votes
1 answer
42 views

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│ └─...
justin2004's user avatar
1 vote
1 answer
39 views

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 ...
RikedyP's user avatar
  • 632
3 votes
2 answers
124 views

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 ...
Mike Chris's user avatar
3 votes
1 answer
50 views

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 ...
Josh D's user avatar
  • 31
3 votes
1 answer
57 views

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 ...
T.P.'s user avatar
  • 133
3 votes
1 answer
43 views

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: ...
RikedyP's user avatar
  • 632
1 vote
1 answer
43 views

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 ← {⎕←⍵} ...
xpqz's user avatar
  • 3,617
2 votes
2 answers
68 views

How provide default values when using ⌸ in Dyalog APL

When using key ⌸ to produce a frequency table, e.g {⍺,≢⍵}⌸'mississippi' ┌→──┐ ↓m 1│ │i 4│ │s 4│ │p 2│ └+──┘ I frequently find myself wanting to 'seed' the result set to provide a count of 0 for ...
xpqz's user avatar
  • 3,617
1 vote
1 answer
65 views

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....
xpqz's user avatar
  • 3,617
2 votes
1 answer
34 views

Access same row/column in each array in nested arrays in Dyalog APL

Is there a way to multiply or add a scalar to the same row or column in each array of a nested array without a loop? For example I would like to multiply all the values in the 2nd column (or row) of ...
xpqz's user avatar
  • 3,617
2 votes
2 answers
36 views

Resuming execution after conditional breakpoint in Dyalog APL

In a previous question I asked about how to set a conditional breakpoint in Dyalog RIDE, and the accepted answer works as advertised, by creating a guard statement with an empty function call as the ...
xpqz's user avatar
  • 3,617
3 votes
1 answer
49 views

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 ...
bRaNdOn's user avatar
  • 1,070
2 votes
1 answer
52 views

Setting a conditional breakpoint in Dyalog RIDE

In Dyalog RIDE, I know how to set breakpoints that will halt execution on specific lines in the APL source. Is there a way to make a breakpoint conditional so I can stop at a line only if a particular ...
xpqz's user avatar
  • 3,617
3 votes
1 answer
38 views

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 ...
xpqz's user avatar
  • 3,617
2 votes
1 answer
38 views

Where is Dyalog installed on Windows?

Some documents refer to things in the Dyalog installation directory. How can I easily find out where that directory is? I searched the internet and found the SETUP README for version 18.2, which shows ...
RikedyP's user avatar
  • 632
0 votes
2 answers
79 views

Boolean array in If guard

According to the Dyalog APL language reference the test condition to the right of :If must return a single element Boolean value 1 (true) or 0 (false) Is there any particular reason why the value is ...
August Karlstrom's user avatar
0 votes
1 answer
77 views

How to use compose operator in APL?

I'm not able to understand compose operator in APL. I have tried but precedence is the issue that I am facing.
Akshay Atanure's user avatar
0 votes
0 answers
39 views

Is it possible to open devtools on the network tab?

I am developing an application in Dyalog APL using its HtmlRenderer object (which is based on the Chromium Embedded Framework). There is a facility to open DevTools - but is it possible to have ...
MBaas's user avatar
  • 7,258
1 vote
1 answer
50 views

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 ...
Bnengon's user avatar
  • 13
3 votes
1 answer
96 views

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 ...
kamilok04's user avatar
1 vote
2 answers
100 views

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 ...
Olexa's user avatar
  • 577
1 vote
1 answer
81 views

(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's user avatar
  • 13
0 votes
1 answer
109 views

Why am I getting intermittent DELETE PENDING errors in Dyalog APL?

I'm getting DELETE PENDING errors intermittently when my program deletes a file and then quickly thereafter creates a new file with the same path as the deleted file. In the Dyalog APL session window, ...
Albert Wifstrand's user avatar
2 votes
0 answers
60 views

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 ...
MLS's user avatar
  • 41
3 votes
1 answer
89 views

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 ...
creatural's user avatar
1 vote
2 answers
97 views

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 ...
MLS's user avatar
  • 41
1 vote
4 answers
124 views

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 ...
August Karlstrom's user avatar
2 votes
1 answer
29 views

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' ...
pamphlet's user avatar
  • 2,054
1 vote
1 answer
45 views

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 ...
Adrian Zweig's user avatar
1 vote
1 answer
23 views

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 ...
pamphlet's user avatar
  • 2,054
1 vote
1 answer
27 views

How to change Dyalog's UCMD source folders on Linux

On Windows the answer is Options>Configure>"User commands"
user avatar
3 votes
2 answers
110 views

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's user avatar
  • 1,264
1 vote
1 answer
116 views

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?
big-chungus's user avatar
1 vote
2 answers
168 views

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/...
Julius's user avatar
  • 304
4 votes
1 answer
245 views

APL Fork/Train with Compression

I want to select elements from an array based on some test. Currently, I am trying to do that with a compression, and I would like to write it as a tacit function. (I'm very new to APL, so feel free ...
j_v_wow_d's user avatar
  • 511
6 votes
1 answer
169 views

Issue with declaring multiline functions in APL

#!/usr/bin/dyalog -script ⍝ /usr/bin/dyalog is a symlink to /opt/mdyalog/18.0/64/unicode/mapl factors←{⎕ML ⎕IO←1 ⋄ ⍵{ ⍵,(⍺÷×/⍵)~1}∊⍵{(0=(⍵*⍳⌊⍵⍟⍺)|⍺)/⍵}¨⍬{nxt←⊃⍵ ⋄ msk←0≠nxt|⍵ ⋄ ∧/1↓msk:⍺,⍵ ⋄ (⍺,nxt)∇...
Perigord's user avatar
  • 111
1 vote
1 answer
104 views

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 ...
August Karlstrom's user avatar
0 votes
1 answer
286 views

Idiomatic graphs in APL

APL is great for array type problems but I'm curious as to how best work with graphs in APL. I'm playing around with leet questions, for example question 662. Maximum Width of Binary Tree, the ...
mazin's user avatar
  • 395
1 vote
1 answer
65 views

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's user avatar
2 votes
1 answer
167 views

Make Dyalog APL Language bar bigger

How to make button size of Language bar bigger in Dyalog APL version 18.0
koly86's user avatar
  • 165
2 votes
1 answer
119 views

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" ...
Fmbalbuena's user avatar
3 votes
1 answer
88 views

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 ...
mazin's user avatar
  • 395
2 votes
1 answer
105 views

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-...
mazin's user avatar
  • 395
3 votes
1 answer
154 views

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 ...
mazin's user avatar
  • 395
2 votes
1 answer
564 views

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 ...
erbsenhexler's user avatar
5 votes
2 answers
326 views

Vector of functions in APL

What is the syntax for a vector (array) of functions in APL? I have tried the following but these are interpreted as a 3-train and a 2-train, respectively: {1},{2} {1} {2} PS. I am looking to do ...
P Varga's user avatar
  • 19.2k
2 votes
1 answer
112 views

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 ...
Rudi Angela's user avatar
  • 1,463