Live data from Hacker News

K7 Tutorial

shakti.com

21–30 of 44 posts

Re: K7 Tutorial

#22

This a typo? x: 3 4 5 6 7 8 9 10 y: 100 200 300 400 ?[x;3;y] / replace what's in position 3 by y 3 4 5 100 200 300 400 6 7 8 9 10

Looks like the comment is zero-indexed as well. I wouldn't consider that a typo.

Re: K7 Tutorial

#23
post #22

This a typo? x: 3 4 5 6 7 8 9 10 y: 100 200 300 400 ?[x;3;y] / replace what's in position 3 by y 3 4 5 100 200 300 400 6 7 8 9 10

Looks like the comment is zero-indexed as well. I wouldn't consider that a typo.

Pretty sure the output should be

  3 4 5 100 200 300 400 7 8 9 10
Otherwise that is not replacing, that is inserting.

Weird, I tried it on http://johnearnest.github.io/ok/index.html and that agrees with the doc.. kinda confusing. Seems like it should be

  ?[x;3;y] / insert y at position 3
  ?[x;3 4;y] / replace what's in position 3 by y

Re: K7 Tutorial

#24
post #22

Earlier quoted context omitted.

Looks like the comment is zero-indexed as well. I wouldn't consider that a typo.

Pretty sure the output should be 3 4 5 100 200 300 400 7 8 9 10 Otherwise that is not replacing, that is inserting. Weird, I tried it on http://johnearnest.github.io/ok/index.html and that agrees with the doc.. kinda confusing. Seems like it should be ?[x;3;y] / insert y at position 3 ?[x;3 4;y] / replace what's in position 3 by y

I see. In that case, the output is right and the comment is misleading.

Re: K7 Tutorial

#25
post #24

Earlier quoted context omitted.

Pretty sure the output should be 3 4 5 100 200 300 400 7 8 9 10 Otherwise that is not replacing, that is inserting. Weird, I tried it on http://johnearnest.github.io/ok/index.html and that agrees with the doc.. kinda confusing. Seems like it should be ?[x;3;y] / insert y at position 3 ?[x;3 4;y] / replace what's in position 3 by y

I see. In that case, the output is right and the comment is misleading.

yeah, I updated my comment after finding http://johnearnest.github.io/ok/index.html so I could test this out and came to the same conclusion.

Re: K7 Tutorial

#26
Does anyone understand if this is fully compatible with Kdb+? been learning q & it would be nice to add vanilla K7 to the list

Re: K7 Tutorial

#27
post #19
post #3

"Customer shall not, directly or indirectly, and shall not authorize any third party to: (i) decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code of, reconstruct, or discover any hidden or underlying elements of the Software" Looks like I don't want to spend the effort learning it.

Just in case you want to look at the sources of something similar, here is a good one: https://github.com/JohnEarnest/ok

I like oK because it allows nice toying around with graphics in the browser but while k is incredibly fast, oK is really slow. It is nice to play with and learn from but anything beyond, better check out Kona or another APL like like A+ or J.

Re: K7 Tutorial

#29
post #26

Does anyone understand if this is fully compatible with Kdb+? been learning q & it would be nice to add vanilla K7 to the list

It is not. Every k version is in fact a new language (and rewritten from scratch every time). That said, I guess they may implement some kind of compatibility layer at some point.

Re: K7 Tutorial

#30
post #11

What's the benefit using k vs. c, cpp or java for the same? Does it run or compile faster? The article says you can do the same with cpp and some extra libraries, but I wouldn't immediately think cpp or java was easily beatable -- manjana wonders --

It depends on what you're doing. If you wanted to analyze some tabular data, k, sql, or even excel are probably more appropriate than c++ or java.
Post reply on HN