« first day (1098 days earlier)      last day (1271 days later) » 

1:04 AM
How do I access the current item in an each loop? This doesn't really work.
 
1:23 AM
Is there a place where I can easily understand Jelly's chain rules?
Because as amazing as Dennis is, I seem unable to fully understand his explanation.
 
1:36 AM
@Lyxal Dennis intentionally complicates his explanations to make Jelly seem awesome.
As another example, Dennis intentionally picks the hardest-to-understand methods to ansewr questions.
@Lyxal Chains are just blocks with arguments.
And then, the whole language collapses into a stack-language. :)
 
@Λ̸̸ sure, but that doesn't help me understand the chain rules.
 
@Lyxal What exactly do you not understand?
 
@Λ̸̸ I feel like I would need to see the rules in plainish english
 
If your request is too broad, I can't help you...
 
2:34 AM
just an explanation of the rules / a tutorial on the rules is what i need.
 
3:25 AM
a tutorial that isn't the one provided by Dennis
for reasons as above
 
 
14 hours later…
5:39 PM
@Λ̸̸ What exactly are you trying to achieve with that program? I don't really understand what you mean by current item.
A loop works as follows: It takes some collection (list, string, integer which gets converted to a range etc.) and it applies a link to each item
Look at the pairs you are applying * on: tio.run/##y0rNyan8/1@H61Hj1sPLHzWt@f//v@V/YwA
I don't know exactly what you intended to do, but I'll assume you wanted to raise 3 to the powers 1,2,3,...,9 (more generally, b to the powers 1,2,3,....,a)
In this particular case, you just need to swap the arguments of * and you don't need any other fancy syntax: *@€
But let's work with the general case, actually. Let's say that you want to apply with some sort of dyadic structure (like *) and suppose it is complex enough so that you need to actually refer to the left and right arguments explicitly. In this case you use ⁸,⁹. In general, means the link's left argument, and is for the right one.
If the link is monadic, then you only need to refer to it.
But in general you avoid these as much as possible.
The golfyness of tacit programming actually resides in the fact that usually you don't need to invoke the argument(s) explicitly with a command.
and then remove the s to see what happens
 
6:08 PM
@Lyxal Honestly nowhere, except for the tutorial. The easiest way to get used to them is through a lot of trial and error. But I'm going to try to make a short summary here.
3
Important note: When I use the (improper) term <commands>, I actually mean <a bunch of atoms/quicks/whatever that don't start a new chain>
Niladic links are by far the most trivial. They start with a nilad (some sort of Jelly-constant) and their structure is <nilad> <commands>. On its own, <commands> (<a bunch of atoms/quicks/whatever that don't start a new chain>) is a monadic chain in this case. So our niladic chain is basically the monadic chain <commands> applied to the given nilad.
Now we need to understand monadic chains in order to grasp how niladic chains are actually evaluated.
A monadic chain takes an argument (which I'll call x) and applies a bunch of stuff to it ("stuff" = monads, dyads, pairs thereof etc.) There are many evaluation rules for a monadic chain: first, they get evaluated from left to right. The initial value is whatever gets passed to it. I'll call it x0. There are 5 cases to consider (bear with me).
1. If the first thing in the chain is a dyad (D), followed immediately by a nilad (N) (i.e. the chain looks like DN...(rest of the chain)...), then the dyad is applied to the pair formed by x and the nilad. This value, dyad(x,nilad) becomes the initial value for the rest of the chain, which will be evaluated afterwards according to the rules.
2. If the first thing in the chain is a dyad (D), followed immediately by a monad (N) (i.e. the chain looks like DM...(rest of the chain)...), then the dyad is applied to the pair formed by x and the monad applied to the initial value x0. This value, dyad(x,monad(x0)) becomes the initial value for the rest of the chain, which will be evaluated afterwards according to the rules.
Important note (I can't edit anymore): When I say This value [...] becomes the initial value for the rest of the chain, which will be evaluated afterwards according to the rules., by initial value I meant the next x. It does not replace x0. Sorry for the bad formulation... and also monad (M)
3. If the first thing in the chain is a nilad (N) followed immediately by a dyad (D) (i.e. the chain looks like ND...(rest of the chain)...), then the dyad is applied to the pair formed by the nilad and x. This value, dyad(nilad,x) becomes the "next x" for the rest of the chain, which will be evaluated afterwards according to the rules.
4. If the first thing in the chain is a dyad (D), not followed immediately by either a nilad or a monad (i.e. the chain looks like D...(rest of the chain)...), then the dyad is applied to the pair formed by x and x0. This value, dyad(x,x0) becomes the "next x" for the rest of the chain, which will be evaluated afterwards according to the rules.
5. If the first thing in the chain is a monad (M) (i.e. the chain looks like M...(rest of the chain)...), then the monad is applied to x. This value, monad(x) becomes the "next x" for the rest of the chain, which will be evaluated afterwards according to the rules.
I won't talk about LCCs here.
And that's about it for monadic chains.
For dyadic chains, there are a total of 6 cases to consider. The dyadic chain takes two arguments a and b and manipulates them according to the following rules:
Let the initial values of the left and right arguments respectively be a and b and let x be the current value through the evaluation of the chain. Typically, x starts with the value a.
1. If the first thing in the chain is a dyad (D1) - dyad (D2) - nilad (N) combination (i.e. the chain looks like D1 D2 N...(rest of the chain)...), then the "next x" for the rest of the chain (which will be evaluated afterwards according to the rules) will be dyad2(diad1(x,b),nilad), if the nilad is a constant.
2. If the first thing in the chain is a dyad (D1)- dyad (D2) combination (i.e. the chain looks like D1 D2...(rest of the chain)...), then the "next x" for the rest of the chain (which will be evaluated afterwards according to the rules) will be dyad1(x,dyad2(a,b)).
3. If the first thing in the chain is a dyad (D)- nilad (N) combination (i.e. the chain looks like DN...(rest of the chain)...), then the "next x" for the rest of the chain (which will be evaluated afterwards according to the rules) will be dyad(x, nilad).
4. If the first thing in the chain is a nilad (N)- dyad (D) combination (i.e. the chain looks like ND...(rest of the chain)...), then the "next x" for the rest of the chain (which will be evaluated afterwards according to the rules) will be dyad(nilad, x).
6. If the first thing in the chain is a monad (D) (i.e. the chain looks like M...(rest of the chain)...), then the "next x" for the rest of the chain (which will be evaluated afterwards according to the rules) will be monad(x).
As a final note for added clarity and recap: for monadic chains I used x0 as the initial value and x as the current value, as the chain is evaluated gradually from left to right. For dyadic chains, the initial values are a and b and the current value is x. In the case of dyadic chains, x usually starts at a, but there are a few exceptions.
I really hope this clears things up a bit, at least.
 
 
4 hours later…
10:51 PM
@Mr.Xcoder my goodness, that really does clear things up.
Thank you so much for writing all that.
 
11:05 PM
No problem :)
 

« first day (1098 days earlier)      last day (1271 days later) »