and on the head of that glyph there's a limit to which it should do the action and on the bottom there's an i = something, which means how far the number 'jumps' from one another
Why limit ourselves to just + and × and why do we need such unrelated symbols for them. The same operation could be done with any dyadic function!
@Konrad'Unrooted'Klawikowski Yes, and that's usually unnecessary noise, as you already know that you want to process "all the numbers".
So APL has the concept of operators which are a type of higher-order functions. In the simplest form, an operator takes a function as its operand and derives a new related function.
It is important to note that while APL doesn't have the normal precedence order with × before + etc. it does have a little bit of precedence: Operators bind any operands they use before any functions are applied.
@KamilaSzewczyk the reason for the parentheses is just that otherwise ⍵ 1 would make an array. We solve that by inserting a ⊢ (the identity function) in the middle just to syntactically separate the two
@KamilaSzewczyk right, just showing that it can be shortened
@ngn By the way, remember the answer I was asking for help with yesterday? I got it down to (6∧⌂life⍣(1…4)⍳⊂)(⌽0,⍉)⍣16, so it's a byte shorter, thanks to you.
@user nice :) generally i avoid golfing in "extended". i can't remember all the extensions and there's no point learning them, as it has no practical use.
Meh, Razetime's original answer was in it, so I went along with that.
And anyway, golfing doesn't really have much practical use - while concise code is good, I just realized I can't read my own code anymore because I keep golfing it even outside of CGCC :)
OK, so the idea with the sugar cube expression as in terms of the number of layers was for you to put all you've learned so far together. Have a go at it!
I don't quite get what you've meant by layers, so I was thinking like every layer is 1+2 x n where n is the number of layer under the one with one sugar cube
OK, let's teach you one more monadic operator. This one again takes a single dyadic function as operand, but derives a dyadic function. The newly derived function is equivalent to the old one, except that the order of its arguments are swapped:
Just like a function glyph like - can be ambivalent (stand for both a monadic and a dyadic function), so too can a derived function be ambivalent.
You now know that X f⍨ Y is Y f X but actually, f⍨ Y has a meaning too, namely Y f Y. Take a moment to digest this, as this was the first time I used APL expressions to defined parts of the language.
OK, so the simplest form of the simple functions, called "dfns" (pronounced "DEE-funs") are just an expression in curly braces, with ⍵ (omega, the rightmost letter of the Greek alphabet) representing the right argument, and ⍺ (alpha, the leftmost letter), optionally, representing the left argument.