Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gabiteodoru
4 months ago
|
parent
|
context
|
favorite
| on:
Why LLMs Can't Write Q/Kdb+: Writing Code Right-to...
Or, even better, also from the cookbook: {(2#x)#1,x#0} But this really borders on obfuscation :P
leprechaun1066
3 months ago
[–]
That does require someone to know that the take operator continues to treat the y list as circular when x is a list.
I think this form might be a bit easier: {(x,x)#(x*x)#1,x#0}
gabiteodoru
3 months ago
|
parent
[–]
But then you're not flexing your q muscles. Btw this is from the cookbook, these obfuscated patterns are actually recommended!
https://code.kx.com/phrases/matrix/#identity-matrix-of-order...
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: