Such a great interview! I really like Elias' points about the tension of expressiveness between very concise code in the REPL being good but that it can backfire in large bodies of code--although I still personally lean towards terseness in both.
@@code_report You need a way to simulate `for j in range(): acc[j] += acc[i]`. It's ugly but you can call `lambda i, j, acc: [x+acc[i] if i==j else x for x in acc]` in a fold. If you want I'll write a solution in Haskell without explicit recursion
Thanks! I'm looking for examples to motivate a finite-state-machine oriented language. You need to simulate: for j in range(): acc[j] += acc[i]`. It's ugly but you can call lambda i, j, acc: [x+acc[i] if i==j else x for x in acc] in a fold. I could write you a solution in Haskell without recursion if you are interested
// z^3 Array of Functions [1..10,1..10]@[➕,➖,SIN] //Arrays of input to Arrays of Functions. // Here ➕is SUM operation. ➖ is MINUS operation etc. // Can also be [1..10,1..10]@[SUM,MINUS,SIN,"a+b"] // @ - Apply Operator
Such a great interview! I really like Elias' points about the tension of expressiveness between very concise code in the REPL being good but that it can backfire in large bodies of code--although I still personally lean towards terseness in both.
24:04 Can you link the problem please? The one you tried to turn into a scan?
It is AOC 2023 Day 4B: adventofcode.com/2023/day/4
@@code_report You need a way to simulate `for j in range(): acc[j] += acc[i]`. It's ugly but you can call `lambda i, j, acc: [x+acc[i] if i==j else x for x in acc]` in a fold. If you want I'll write a solution in Haskell without explicit recursion
Thanks! I'm looking for examples to motivate a finite-state-machine oriented language. You need to simulate: for j in range(): acc[j] += acc[i]`. It's ugly but you can call lambda i, j, acc: [x+acc[i] if i==j else x for x in acc] in a fold. I could write you a solution in Haskell without recursion if you are interested
// z^3 Array of Functions
[1..10,1..10]@[➕,➖,SIN]
//Arrays of input to Arrays of Functions.
// Here ➕is SUM operation. ➖ is MINUS operation etc.
// Can also be
[1..10,1..10]@[SUM,MINUS,SIN,"a+b"]
// @ - Apply Operator