@Bubbler When you absolutely need an impure function and the argument just isn’t necessary? Is it idiomatic to pass in an empty list and ignore it inside the function?
@Fmbalbuena TryAPL executes expressions and captures the results, feeding them back to the frontend. Inline printing would need to be paired up with what caused it, which is non-trivial because all the incoming request are run in parallel in the same single interpreter.
That said, I think I just came up with a way to do it…
:59873434 Please do not remove your mistakes, as that makes the transcript hard to understand for others. If you need to experiment, you can do so on TryAPL or in the Sandbox.
@rak1507 Yeah once I figured out a couple of optimisations mine got shorter - I'm sure I could clean up my part 2 and make it more functional - maybe I'll do that and then do a runtime test between matmul and key
@Adám right, I'm also not that happy about my ref hack '#.kit.'∘,¨
I mean a function or namespace having its own import statements isn't a bad thing, but we're just bumping up against the slightly ugly way Dyalog handles system shizz
so Tatin's philosophy is that a package does 1 thing. So I wouldn't have my kit bag from which I choose tools which I might depend on, I would explicitly depend on each tool in the kit bag, and have the foresight to know which I'm going to need. This makes sense for the larger tools that constitute Tatin packages, and APL traditionally you'd just copy the function definitions verbatim into namespace a la github.com/the-carlisle-group/Dado/wiki/On-the-Use-of-Packages
What I did try to figure out was a nice maths-oriented solution for yesterday. But I haven't made it yet
Because, in maths, parallel reflections can be merged.
So, I think there is a way to parse all folds first, separate the X folds and the Y folds, and boil them down.
The only issue is that the problem statement doesn't really deal with reflections, but only with "half" reflections. Still, I feel like there should be a way to merge the folds...
@RGS yeah for me it's the fudging of the size of the paper that's gonna be the piece to crack - I wonder if you condense the repeated reflections into a single transformation, and also work out the "bounds" after all the folds, then you can just ignore the points which fall outside the bounds?
Hi, thank you. Was reminded that I really should learn some APL after writing a depressing amount of (vector-set! v i (+ (vector-ref v i) 1))-style code for today's AoC problem and having it suggested that maybe I should use a language that's actually good at arrays for that sort of thing.
Trying the Rosalind problems to figure out the basics but I'm having some difficulty with inputs/outputs that are fairly long - was able to get one question working with ⊃⎕NGET but even then it choked on the terminating newline initially and then I had to manually remove blank lines and indents to submit the output...
thanks, that does make the input side of things better. don't suppose there's anything convenient like a way to copy the result of an expression directly to clipboard (without boxing/indents/extra whitespace between lines/etc)?
Then yes, you can copy to clipboard. Store your array in a variable, place text caret inside or to the right of variable name, and then from the menu, select Action>Copy Object (or click the corresponding toolbar button, which is the second one on the Object bar)
You can also do it under program control/as an expression: (⎕NEW⊂'Clipboard').Array←…
thanks! definitely says something about something that I'm spending more time trying to get I/O working than writing {'TGCA'['ACGT'⍳⊖⍵} or whatever. what it says about what, I'm not exactly sure yet ^^
hm, I appear to have lost a square bracket in the copying. oh well.
Also, I highly recommend putting backticks around your code, so backslashes and other APL symbols are not interpreted as Markdown. You can press UpArrow to edit your messages for 2 mins.
is there any way to get ⎕NGET to use a relative path instead of absolute? (or, at least, if it does use a relative path, it doesn't start in the folder my .dws file is in...)
It is always relative… to the current directory. You could change the directory you start APL in (hint: change the shortcut) or change the current dir from inside APL with ]cd targetdir
@user1115629 Look at all three occurrences of "circular" here.
One of the reasons is that it is a scalar function and most APLs have no scalar strings. That said, the A+ dialect did have "symbols" and allowed `sin as left argument, but numbers were recognised to be faster.
thanks. unrelated and let me know if I'm asking too much random stuff but. is this reasonably idiomatic or did I miss a better way? count ←{+/⍺∊⍵} and then basecount ← {⍵ count⍤1 0⊢'ACGT'}
@user1115629 Don't worry – keep asking. I'm always happy to answer. Although for fastest answers, you might want to check aplcart.info with simple questions.
@Adám I'm able to run Ride on WSL2 in Windows 11 but I will get the following error message [14197:1214/215604.144917:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command. What should I do?
@kimmolinna You are running RIDE as a Linux GUI application under Windows? In the short term, you might try running RIDE under Windows instead. Unfortunately this means you need to know the IP address of the WSL system, which will change at each boot.
I don't know that anyone at Dyalog has tried running the Linux RIDE under WSL
Hi, I started writing a site just with static files (HTML, CSS and JS) to host it on GitHub Pages. I wanted to execute APL functions within JS, but couldn't figure out how. I think that one way could be use tio.run, but couldn't understand how it convert the data. Any idea, or other alternatives?
For the FRC problem, I imagine this was not what I was meant to do - would like some advice on improving it. {(1=(⍸'R'=⍵)⍸(⍵⍳'K'))∧2|+/⍸'B'=⍵} (Problem: problems.tryapl.org/psets/…)
@user1115629 That's a fine solution. I'd maybe swap the arguments of ∧ to even out the parenthesis levels, but that's really minor. Btw, there'll soon be a commentary blog post coming out about those problems.
@Adám Ohh yes, I've completely forgot about it... But are there some source about it? On aplwiki.com there are only an example and in the Webinar, Richard doesn't talk a lot about it
@MortenKromberg I was able to set up ssh on WSL2 so that it starts automatically on log on so I don't have to know any ip addresses. I can start Ride from localhost and It's starts an interpreter from WSL2 (/opt/mdyalog/18.0/64/unicode/mapl). It's easier like this because now I can use Dyalog APL IME on Windows. It's not working if I start Ride directly on WSL2.
@MortenKromberg I will write down the instructions tomorrow....