I'm doing Advent of Code this year to learn Q. For bewildering one-liners, you can follow along here:https://github.com/willcrichton/aoc2021 …
-
-
Q's combinators are interesting. Especially overloading on arity: f' = map f x f' y = map f (zip x y) x f/: y = map (f x) y x f\: y = map (λ x. f x y) x f/ (unary) = fix λ g. λ y. if f y = y then y else g (f y) f/ (binary) = reduce f x f/ y = fold f x y x f\ y = scan f x y
Show this thread -
Using fold instead of for-loop is annoying. But one benefit: flip a character to unroll the state of the fold. q) ((); 0) check/ "()({)" "({" 3 q) ((); 0) check\ "()({)" ,"(" 0 "" 0 ,"(" 0 "({" 0 "({" 3
Show this thread
End of conversation
New conversation -
-
-
Wouldn't that be APL?
-
Yes, Q is a modern APL.
End of conversation
New conversation -
-
-
There’s an interesting fork in history between APL → J → K → Q from 60s and SASL → KRC → Miranda → Haskell from 70s.
-
2022 is the Kenneth Iverson comeback!
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
cognitive psychology. PhD