« first day (1048 days earlier)      last day (48 days later) » 

12:53 AM
@Adám Hash Array help entry says that certain primitives (are expected to) run faster with hashed arrays. Do you have the complete list of "certain primitives"?
 
 
4 hours later…
5:23 AM
Ugh, Advent of Code day 9 requires bignums ⍨
 
@voidhawk How big?
 
Right, I just saw your stackoverflow answer - I think I can get away with 34 digits
 
Some challenge writers tend to keep the numbers under 2^64, so that users can compete using C/C++ (and the like) without extra hassle. In that case, Dyalog APL can compete easily using the 1287/34 trick.
@Bubbler This also applies to Project Euler (and you even get a free pass on a challenge that asks for 10^25).
 
 
1 hour later…
7:06 AM
@Bubbler I'm fairly certain it is the same list as given here.
 
 
9 hours later…
3:52 PM
CMC: do this for a given power of 2 size N. Starting with 0 or transposed output is fine. Examples:
https://tio.run/##LZhLkuQ4DEP3PoWOYP2l43TMfjYdMdevwXuuVVa60jYEgiTIf/78@9@fvz8/9XlqGU8v7XlKLWWVWktdT5mltFJnqe0pt9RRSi/lPLWX@payS27ihnypt7RT@i5jlTnLGtyQm9su7S1jln7K6mWup@bK4kG1ldnLaqXfMs7T8prDi8soq5Y5ysjT3qf3MvLLWlZeOQHReuntGbX0UeYtMxA7oHstbTwjV4JklpFf5jcCzWHmLjNIcu8qLWg9WA7zFI6cV3MPDysryE84eMGYo@VUNXDqzknPyXlm7s7RgrvlQPlH4ahg5OHl5Dk794WT@ua@nLLm@PXkOTv3BVV7AyI8tRyw5IRAk1ze9@Y94Mn7St5Xg6eCJ@@rM/cFTwue9uYzBy45MVQQA8irwVPf4Mn7St5Xg6eCZ8Lem3sT6OBp4bG95ykLHvL7m@fX4Dfs@Z73Fd4XPC14WvhpkB3mayiuO8@7UcZBMmgm39@cI@cjHOig8D4iHjwt/LTwUxOJmpDWm@fs8HfzHW2t4D1oLJ85nwJrhDs4w09LPBr87PB585lY1vU@lejf8HVQQT5zPuS
 
4:10 PM
APL newbie here. I'm trying to rewrite this recursive function fr ← {n←(f⍵) ⋄ n + (∇⍣(n>0))n} using the f⍣= idiom, which I understand is how one writes fixed point functions. What I want to do is sum every step on the way to reach the fixed point and that is where I'm stuck.
 
4:20 PM
@PuercoPop so "sum of repeatedly applying f on while ⍵>0 plus two times the ≤0 item"?
(but in general, if you want to use the intermediate terms of repeated application, will not give nice solutions)
 
4:46 PM
@aierl Can you tell me which command you typed to install Dyalog APL?
 
@dzaima To give further context this is for advent of code day 1 part 2. My initial idea was "sum of repeatedly applying f on ⍵ while f⍵>0. But I modified f to never return less than 0. So "sum of repeatedly applying f on ⍵ until successive applications of f⍵ return the same value (which would be 0 for f)" is what I'm trying to write
(So f is f ← {(¯2+⌊⍵÷3) ⌈ 0}
 
@PuercoPop Btw, if you put backticks around your code, it'll look better (and you avoid markdown understanding some APL symbols as markdown).
 
@Adám Thanks for the tip. This is my first time using a SO chat.
 
@PuercoPop Welcome to the APL Orchard :-) Also, you can reply to a specific message by hovering over it and clicking the bent arrow () which inserts a tag :12345 into your message. This will ping the author of that message and indicate what you're replying to.
 
5:05 PM
@Adám Trying it out. I'm more used to IRC. I hope I can learn more how to think 'in arrays' using Advent of Code.
 
@PuercoPop if using , best i can come up with is {s←0 ⋄ {s+←f⍵}⍣= ⍵ ⋄ s}; imo here recursion is better
 
@dzaima Indeed explicitly using an accumulator doesn't seem desirable. If what I had is idiomatic enough I'll move to the next problem
 
a prettier recursive solution would be +/{∧/0=⍵:0 ⋄ (⊢+∇)f⍵}
 
5:24 PM
@dzaima Thanks, I'll spend some time understanding how it works
 
 
6 hours later…
10:58 PM
@PuercoPop dfns.traj gives the list of intermediate values.
 
11:09 PM
I think it uses tail recursion with cumulative left argument, which is just a fancy way to replace an accumulator variable.
 

« first day (1048 days earlier)      last day (48 days later) »