« first day (1456 days earlier)      last day (913 days later) » 

7:16 AM
So $ says last two links (if not part of an LCC) as a monad
what does it do if it is an LCC?
I'm a bit confused still on the functionality of LCCs exactly
 
I feel like we figured out what that means in that exact context a while ago but I am drawing a blank
 
AFAICT they just change the chaining rule of 2 2 0 from dyad(v, dyad(left, right)) to dyad(dyad(v, right), nilad) if the remainder of the dyadic chain consists of monadic combinations like H, +0, 0+
i have apparently asked this question before
multiple times in fact, according to chat search
 
checks out
 
i can't recall having weird behavior due to LCC stuff lol
might have to go do some testing on this
 
let's see, which regex at the bottom of interpreter.py is responsible for this
 
7:27 AM
1 + 1 2 + + 3 $ $ outputs 27 but I think that's smash-printed
i believe it does [1] [+ 1] [2] [++3] which would first evaluate 1, then add 1, and then the nilad 2 causes the 1+1 to be printed, then the first + does v=v+L so 4, then +3 to that
 
in which case i'm not sure how $ behaves differently with LCCs
cuz 1 +1 2+ +3 should be an LCC?
 
i think so yeah
maybe the adicity is niladic if it's an lcc but there's no way it wouldn't just say that instead
 
7:48 AM
i get the idea behind the 2,2,0 chaining rule for LCCs since it doesn't make sense for the nilad to belong to the chain following it so instead it completes dyadic evaluation and then essentially becomes a monadic chain from there
but i don't actually know if $ behaves differently anywhere. not sure though
 
i do not understand the quick parsing code to begin with so even more so i cannot understand what quickchain does
 
lol rip
 
how does arity even come in
 
the arity is bound to the condition function
 
7:52 AM
it appears that the condition function dictates when quickchain should stop consuming links?
 
oh yeah i forgot that arity is adicity lmao
 
i think so yeah
 
lol
lambda links:
    len(links) - sum(map(leading_nilad, split_suffix(links)[:-1])) >= min_length
god this looks exactly like the kind of code i'd write and i have absolutely no idea what it's supposed to do
 
wait yeah condition gets the links popped already
i was worried that it was actually stateful lmao
 
7:54 AM
lol
split_suffix just returns... well, all suffixes of the array
 
so split_suffix(links)[:-1] is all suffixes of the array except the one containing just the last element (so all len 2+ suffixes)
leading nilad is literally just "is this an LCC"
and uh
def leading_nilad(chain):
    return chain and arities(chain) + [1] < [0, 2] * len(chain)
tf is this black magic
 
it took me a second to figure out the operator precedence there tbh
 
same, it was so confusing i thought the [1] was within round brackets somewhere somehow
 
[0, 2] * len(chain) is just python not having infinite lists :(
 
7:56 AM
:c
 
so it's...
the chain is nonempty, and
if you pretend there's an extra monad at the end, it's lexicographically smaller than [0, 2, 0, 2, 0, 2, ...]
 
so it has to start with a nilad
and then either it is followed by a monad in which case it matches
or it can be followed by a nilad (? i guess that makes just the single nilad a 1-length LCC?)
 
guess so yeah
 
and if it's followed by a dyad, that must be followed by a nilad of its own, and then rinse and repeat
this feels really hacky but i trust dennis :P
 
:P
yeah
it's the golf skills taking over
 
8:00 AM
so it will keep popping until the number of links it has consumed is at least 2 greater than the number of points in the list of links, except the last link, such that an LCC begins there
wtf
 
points?
 
like
indices
 
8:15 AM
While this isn't really formally stated, the 2,2,0 rule only applies if the entire rest of the chain is an LCC
which is what I expected but it doesn't specify that
and the regex for LCC, ^0(1|02|20)*, doesn't end with a $
 
dennis's IQ has more digits than my IQ itself so i can't understand how he came up with these or how they actually work :p
 
 
1 hour later…
9:23 AM
wait, why does 2,1 not link in dyadic chains lol
i mean you do have }
 
i presume wanting F(a+b) is more common than a+F(b)?
idk
 
yeah i think it's mostly that
plus you'd have to do more pattern breaking stuff if you want to apply a monad to the result of a dyad that isn't chained with another dyad
because you have to do that sometimes in monadic chains
 
that's true
in monadic chains at least you can use mu but that breaks some things
 
but in a dyadic chain, if you're using a monad, you can just about guarantee there's a dyad somewhere
you can also use ¹
 
9:27 AM
is there any divider to just break apart two things from chaining without modifying the current value or either argument?
oh yeah that's true
 
i tend to use µ wherever it works because it looks nicer
 
but yeah and then the third thing about dyadic 2,1 which i guess is mostly the first thing is that pretty often you need to monadically process zero or one of the arguments, and if you need to process one then you can choose to make it the left argument rather than the right
 
oh yeah that's a good point
 
 
7 hours later…
4:11 PM
3 , 4 ! $ gives [6, 24]
so rather than grouping 4 !, since that's an LCC, it groups , 4 ! and therefore the 3 gets factorial'd too
which is the same result as w/o $
3 , 4 , ! $ gives [[3, 4], [6, 24]] groups , ! so the [3, 4] gets paired with [3!, 4!]
whereas without $, it's [[3, 4], 6] since the chaining rule for , ! applies , to [3, 4] and (larg)!
the last two atoms can only be an LCC if they are 0,1
the last three can only be an LCC if it's 0,0,2, 0,2,0, or 0,1,1, none of which work with the last two being 0,1
in other words, $ only changes its behavior if the last two atoms are a nilad followed by a monad, in which case, it groups the last three
idk how the multi combinators work. probably similarly
if the last N atoms is an LCC, the last N+1 cannot possibly be an LCC
 
5:13 PM
Do chain separators work like parentheses in APL and other languages?
 
 
3 hours later…
8:22 PM
@user Kinda
@hyper-neutrino A chain is an LCC if it's a nilad followed by one or more (dyad-nilad pairs, nilad-dyad pairs, monads). Quicks work by having a condition which dictates when they stop consuming previous links in the chain. Some links (e.g. $) have different behaviour depending on if one of the links they consume is an LCC or not
 
oh okay
 
E.g. 4H²+2 is an LCC, but 4H²+ isn't
 
after digging through source code and testing
i think i get how $ and 2,2,0 work in relation to LCCs
always knew what LCCs were but didn't get how they affected stuff lol
 
2, 2, 0 should never form an LCC by itself, so $ will only consume the 2, 0 at the end
@hyper-neutrino Yep, the only reason I know this stuff is by figuring out how the code works when adding stuff in my fork :P
 

« first day (1456 days earlier)      last day (913 days later) »