Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rak1507
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
19 ms
·
181.
▲
by
rak1507
5y ago
Yeah, I've not used lisps much myself but it's definitely similar. See https://kparc.com/lisp.txt . The quote by Alan Perlis, 'It is better to have 100 functions operate on one data structure than 10 functions
182.
▲
by
rak1507
5y ago
Size of a file in bytes? Nothing built in (afaik) but pretty easy to define yourself. hcount:#1::
183.
▲
by
rak1507
5y ago
This is APL, k is a descendant of APL.
184.
▲
by
rak1507
5y ago
Or alternatively '*',⍨⊂⊃K which I think I prefer over ⌽, but neither seem that 'better' in my mind anyway.
185.
▲
by
rak1507
5y ago
Ok, that all makes sense, thank you. And thanks for pointing out the pattern in the first place, it makes sense now how you were able to parse the original expression so quickly.
186.
▲
by
rak1507
5y ago
Ah, ⍷, clever, don't even need the outer {...⍵}, us←'_'@{¯1⌽⍵⍷⍨(⊂⊃K),'*'}
187.
▲
by
rak1507
5y ago
Thank you for the extensive answer, that's very interesting that there's such a performance difference. I would have naively assumed if anything keeping it as a constant would be faster. Another question: Why do $[#i:& XXX
188.
▲
by
rak1507
5y ago
Why do you pass in (*K;,"*") as x instead of hard-coding it in x~(z;y)? Clarity?
189.
▲
by
rak1507
5y ago
⍵≡'*' should be ⍵≡,'*' like in the original k us←⊃,⍥⊆2{(⍺≡⊃K)∧⍵≡,'*':,'_'⋄⍵}/⊢ is shorter anyway
190.
▲
by
rak1507
5y ago
No problem
191.
▲
by
rak1507
5y ago
I have just finished transcribing it (quite roughly) https://gist.github.com/rak1507/3aec8c0b720e6d8a9ef121fc14e4...