« first day (2108 days earlier)      last day (547 days later) » 

2:19 AM
I have a strange train that I want to see if there's an alternative for
(⍸∨/) f (⍸∨⌿)
any suggestions?
I need to know the locations along both dimensions
⍉ f⍥(⍸∨/) ⊢ seems a bit wasteful
 
 
3 hours later…
4:56 AM
@nathanrogers I don't think there's much more to do than ∨/f⍥⍸∨⌿ without knowing what f is.
 
f uses the distance between where 1 in each list
 
Right, then you can't really use the bitmasks directly. Any preprocessing of the arguments can of course be moved out into
 
but is doing ⍉ f⍥(⍸∨/) ⊢a performance hit?
 
Yes, and why would you when you have ∨/f⍥⍸∨⌿ ?
 
missing ⍸ on left, but yes
 
5:03 AM
No, why?
 
where are they found
(⍸∨/) f (⍸∨⌿) was the original
where vertical, where horizontal
 
oh I see, I didn't understand you were altering it intentionally
 
Altering it?
 
nevermind
 
5:07 AM
;-)
 
question: does ⍣ iterate once more after the failing condition, when the right operand is a function?
I had a < comparison, but it would continue 1 additional iteration
 
Yes, it keeps going until the condition holds.
 
hmm, so it has to be false twice
never knew that
 
No, it has to be true once.
 
then... once more right?
 
5:10 AM
No, exactly once.
 
because I had an expression like 0∊Val>intMat so I could find the first instance when Val was greater than
but intMat would always have 2 values greater than
 
Well, I have no idea how they are being changed, so…
Again, context is key here.
 
one index at a time
in a matrix of unique integers, I want a new matrix with the cumulative stencil sum of that index and its surrounding values
so I am inserting the cumulative sum of stencil on the new matrix into the matrix at index I
 
I'm too dumb to infer what your code looks like.
 
5:17 AM
⎕←1+⍣{⍺>10}5
 
@Adám 11
 
Clearly, stops as soon as the condition is true.
 
if you look at this solution, I always get 2 values back
had to create mv to get the max value afterwards
how do you return new values of ⍺ when using ⍣
for the purpose of accumulation?
 
where?
 
not in this example
 
5:23 AM
\○/
 
I'm dealing with another example, where I'm struggling to accumulate values
I need to accumulate, but recursion is too deep
if I apply the function repeatedly, it accumulates
when I use power it does not accumulate
if I say x←in ⍵ ⋄ _←ps¨x ⋄ _←ps¨x ... accumulation takes place as I'd expect
when I use ⍣ as in sn accumulation does not take place
check up for update
I have comments for these, adding them now
 
tl;dr, but my first guess would be that using instead of does the trick.
 
?
no I was asking a different question from the problem I'm having
right now I'm returning ⍵ with elements removed that have been updated in ACCUM
I was asking if there was an accumulator ⍺ you could pass to a ⍣ function because ACCUM is not accumulating after the first iteration of ⍣
when I call sn at the bottom, that does not accumulate anything after 1 iteration, so nothing is removed, and so the loop is infinite
I was asking if there is another accumulation method using ⍣
I don't understand how ⍺ works with ⍣
and I'm asking how you would accumulate with ⍣
 
You want intermediary values until the condition holds?
 
I want to accumulate a table of values. When the desired value is in the table, return that value
But the input is a list of rules that cannot be processed until other values are in the table
so the desired value cannot be processed until all intermediate values exist in the table
 
5:33 AM
Sorry, too much text to process for now. I'll try get around to reading it later.
 
Repeated application does in fact accumulate
for whatever reason when using ⍣ it does not accumulate
and the more applications I hard code the more values are accumulated, and the fewer remaining steps to process
so all the functions work as expected... until I try to use ⍣
after 1 iteration of ⍣, the length of ⍵ remains constant
which doesn't make any sense because repeated applications does in fact accumulate
same thing happens when I use recursion...
1 iteration accumulates, every subsequent iteration fails to accumulate
nevermind, this has something to do with the rm function...
finally have a working solution... jeez
oh jeez that's unexpected
@Adám so the name column of the accumulator table has single characters and multiple characters. What was happening is that single character names were matching multiple character names
 
6:21 AM
oh well, works now
I wan to figure out how to accumulate more elegantly. Global ACCUM table is not a very good way of doing that
 
7:19 AM
@nathanrogers I don't know of a better way, but the second statement in {ACCUM⍪←⍺ ⍵ ⋄ ACCUM∘←ACCUM} is a no-op (and uses unsupported syntax).
 
 
1 hour later…
9:24 AM
Is there some mnemonic trick to remember which is which of ⊥⊤? I have to look it up every damned time.
 
@xpqz Did you look for them on apl.wiki/mnemonics?
 
:D who knew?
 
is from base and is To base.
(that last part wasn't on the wiki — added now)
 
My, that is one handy page.
One think I like with aplwiki is that it provides model APL implementations of many primitives -- very helpful.
 
9:57 AM
@user153002 Hi Chani Lauzon. If you want to participate here, please email access@apl.chat
 
 
2 hours later…
12:08 PM
@nathanrogers github.com/rak1507/Advent-Of-Code-APL/blob/main/2015/… here's my day 7 if you're interested
it's a bit of a mess
 
12:19 PM
@Adám what's the way to do a topological sort in apl
 
 
2 hours later…
1:52 PM
@Razetime "the way"? I don't know.
 
2:23 PM
@Adám like is there a well known way to do it
couldn't find an aplcart entry.
 
I don't know.
 
2:36 PM
@rak1507 (≢¨⍥⊆⊆⊢) I'm assuming this is (≢¨⍥⊆)⊆⊢ ?
 
Yes, that's how trains work.
 
no, I'm just wondering what this functions does
count of the enclosed partition right?
I thought partition works on boolean array
'->'(≢¨⍥⊆)'af' 'b' 'd' '->' 'c' no I guess its not match
 
I assume it is to be called dyadically. If so, it encloses each argument if it is simple, then looks at each corresponding elements differ, and splits the right one accordingly.
 
its like a vector split
that's a nice idiom
 
Btw, partition takes a non-negative integer, not just boolean, left argument.
 
@nathanrogers Thanks! Indeed I did miss it - I'm not quite as present here as Adám. By the way, we'll happily accept any requests for content - videos or text or even podcast topics - that you might want
 
There's a book
 
@nathanrogers I tend to take those one sentence at a time
 
:P I'm looking for the name
yeah nevermind I can't find it
 
3:12 PM
⍕¨∇¨a⊃⍨f⊂,⍵ ok I get this, sort of... find ⊂,⍵ in a, which is the list of tokens to be assigned to the name ⍵. And continue to find those... But what I don't understand is when a number is encountered, and it isn't found, how is that ever returned to be evaluated by the rest of the expression?
in fact the only thing I ever see being returned is when ⍵ is a function name until 'a' is evaluated in vals
this must be some behavior of in conjunction with 0:: that I'm not familiar with
 
3:32 PM
Announcement: BAA webinar (open session) in 30 minutes: Zoom 858 532 665, passcode: ⎕←×/1920 12 17
 
@Adám 391680
 
what is BAA?
 
3:51 PM
I knew that...
 
 
1 hour later…
5:04 PM
IDK if those subjects are things you're interested in @Adám.
 
Sure. I've added what you wrote to our internal episode planning doc, and will take it up with Richard.
 
@Adám is there a side channel I could DM you in? Don't want to bog down the chat
 
You can DM me on the farm.
Or email me.
Or private tweet.
 
ok, I'll find you there
 
 
2 hours later…
7:46 PM
@rak1507 I'd really love an explanation of that ∇ expression and what happens with numbers. It recursively finds functions and keywords, but errors on numbers, since there are no numbers in the b list, and so can't ⊃ from it.
 

« first day (2108 days earlier)      last day (547 days later) »