« first day (2178 days earlier)      last day (479 days later) » 

5:41 AM
@Jeremygee In general, APL is backwards compatible. Afaik, the only things missing/different in modern APL are s and the ability to print multiple arrays with array1;array2;array3
 
 
5 hours later…
10:55 AM
@Adám Ah okay. I take it this means that the issue is on people's radar, albeit perhaps not yet getting dev attention?
@MortenKromberg Ah, okay. Thank you for getting me up to speed on the terminology here. Is this stuff pretty relevant for the DWA interface?
@Adám Ah! Thank you for remembering!
 
@B.Wilson The important thing to know when using Direct Workspace Access is that pocket pointers can move on compaction, and you need to use the mechanisms provided to deal with this rather than just operate blindly on the pointers. DWA is only semi-public because we like to have a chat with people before they start using it, since careless use can damage the workspace.
In many ways, you void the warranty by using DWA...
 
11:22 AM
@MortenKromberg That makes sense. In general, any GCable pointers are pretty much completely ephemeral unless you have tight GC control.
Not to worry. DWA is just on my mind a bit, having recently heard about it. I don't plan on willy-nilly poking at any workspaces just yet.
 
 
2 hours later…
12:54 PM
Am I correct that the Maths workspace isn't working on the Mac? From a quick look there doesn't seem to be any real reason for this, so maybe it's just a matter of no one requested it?
 
 
5 hours later…
5:29 PM
Hello, Can someone please guide me on how I can read/understand something like this in line 6 from this example of the testing chapter in Learning APL?
```
:Namespace unittest
⎕IO ← 0
run←{
tests ← 'test_.+'⎕S'&'⎕NL ¯3
0=≢tests: 'no tests found'
↑{⍺,('.'/⍨30-≢⍺),⍵⊃'[FAIL]' '[OK]'}⌿↑tests (⍎¨tests,¨⊂' ⍬')
}
:EndNamespace
```
 
6:18 PM
That looks like something I wrote. If you start from the right of line 6...
...we create a vector of strings where each string is the name of a test function with a space and zilde tacked on the end.
These are the evaluated with hydrant, and turned into a two-row matrix with the test names as the first row, and the results (0 or 1) as the second row.
We then reduce alomg the columns -- basically just calling the dfn with elements from the top as ⍺ and the bottom as ⍵.
The dfn prints either [FAIL] or [OK] depending on ⍵, and does some fancy footwork to line up the test name and this result text with a bunch of dots.
This ('.'/⍨30-≢⍺) replicates the dots to a fixed length (30), allowing for the length of the string holding the test function name.
To the right of that we have a pick: ⍵⊃'[FAIL]' '[OK]'
..and to the left the function name itself: ⍺,(...)
When I'm faced with a line of APL I don't understand, I just start from the right and evaluate it bit by bit in the debugger.
Use the debugger to step until you're just before the line.
Then cut and paste little by little and execute it.
So in this case, perhaps you'd start with:
      tests
┌→───────────────────────────┐
│ ┌→─────┐ ┌→─────┐ ┌→─────┐ │
│ │test_1│ │test_2│ │test_3│ │
│ └──────┘ └──────┘ └──────┘ │
└∊───────────────────────────┘
      tests,¨⊂' ⍬'
┌→─────────────────────────────────┐
│ ┌→───────┐ ┌→───────┐ ┌→───────┐ │
│ │test_1 ⍬│ │test_2 ⍬│ │test_3 ⍬│ │
│ └────────┘ └────────┘ └────────┘ │
└∊─────────────────────────────────┘
If you know what does, then seeing ⍎¨ before tests,¨⊂' ⍬' might give you a clue how that hangs together.
In other words, the test functions are expected to be pseudo-niladic, that is they don't use their right argument. You can't write proper niladic functions as dfns (you can if using tradfns, but tradfns were out of scope for Learning APL).
 
6:38 PM
Oh yess! THANK YOU SO MUCH. Now I understand it.

I guess using the debugger will truly help in such cases. I will try that.

Thank you for the clarification of the pseudo-niladic function, I was wondering why we need the zilde.

> ('.'/⍨30-≢⍺)
This is so smart and confusing and simple to look at, at the same time. IDK to express it.
@xpqz Again thank you for the book, I have read through most of it by now. It is a beautiful book. I also love the quotes in each chapter. I've learnt a lot of it
 
That's really great to hear.
 
@sloorush For next time, leave out the ```s and press Ctrl+k to indent each line 4 spaces, as this will make it a code block.
 
@sloorush The next bit in that chapter gets a little bit hairier still -- if it doesn't make sense, try the same approach: piece by piece from the right.
 
@Adám Oh okay! Thanks
@xpqz Okay! I will try
 
This is actually a practical way of doing an "if statement": ⍵⊃'[FAIL]' '[OK]' -- although you need ⎕IO←0 for that to hold as-is.
 
6:48 PM
Otherwise, ⊃condition⌽falseValue trueValue works with either ⎕IO
(although you need ⎕ML←1 for that to hold true)
 
 
1 hour later…
7:55 PM
Anyone has a solution to leetcode.com/problems/… shorter than 8 characters?
 
 
1 hour later…
9:07 PM
Hi! I was trying to install Dyalog APL on Fedora 37, but I couldn't get something to work properly. Dyalog is from the terminal and I couldn't enable the keyboard mapping.
Ride (installed from the latest release in GitHub) have a problem with the keyboard too: I have installed "Italian" and "English (UK)" keyboards on the system, and when I open Ride, it uses the active keyboard as normal, the other keyboard as the APL one (Like instead of pressing CTRL+R, I just have to press R), so it's a problem too, because, for example, to write five negative numbers I have to continuously change between one keyboard and the other one (or also to delete something)
It's also possibile that I've done some errors trying to install it, cause I've tried a bounch of things, before I could get something that works in someway
In conclusion... Do you suggest to install it on Windows, or is there a way to have something good also on Fedora?
 
unfortunately, as far as I know, the xkb keyboard setup can't really work with multiple layout options, as it uses multiple layouts itself
oh, fedora 37 may be using wayland, where the situation might be different but I doubt you'll get to a different conclusion
within RIDE you can use backtick input (i.e. `2 to enter ¯), as an alternative to modifier-key-based input
 
@dzaima Is the problem that it detects multiple keyboards? Should I remove one or is there the option to let it access just one keyboard? Because I don't really need both when programming in APL
@dzaima I may have gotten used to use the CTRL key... So if there isn't a solution I'd rather have it on Windows
 
unless you're on Dyalog ≤17.1, I don't think RIDE by itself should be touching keyboard configuration at all
 
What about Dyalog from terminal? Can it recognise keyboard shortcuts?
 
9:25 PM
pretty sure there's no in-terminal input management for Dyalog
annoyingly, xkb doesn't appear to even have an option for left control used as the layout switch key; but setxkbmap -layout au,apl -variant 'gb' -option grp:rctrl_switch uses right control to switch between uk & APL
 

« first day (2178 days earlier)      last day (479 days later) »