« first day (23 days earlier)      last day (1512 days later) » 

00:47
how do you make a keyed table in k7?
if the "flipped dict" is the only way of making a table in k7, i probably don't mind it; the '+' at the front of +[a: 1 2 3; b: 4 5 6] is suggestive of "t" ie table
also how does \u work? what do the cols represent?
also i found a kdb IDE: timestored.com/qstudio
01:04
feels like \lf, \lc etc should be dicts from the word go instead of needing to convert per groups.google.com/forum/#!topic/shaktidb/kyxGs9n2Vmc
01:26
@chrispsn ([a:1;b:4];[a:2;b:5];[a:3;b:6])
@yiyus ah, nice!
@yiyus there's no way to get the opening and closing parentheses on their own lines without the newlines stuffing things up, is there?
so not:
tt:([a:1;b:4]
    [a:2;b:5]
    [a:3;b:6])
but:
tt:(
    [a:1;b:4]
    [a:2;b:5]
    [a:3;b:6]
)
the trailing ')' is not ideal for diffs
01:43
wait. is that second form working for you?
btw, if what you want is to enter data "row by row", but you don't want to repeat the key every time: ab!/:(1 4;2 5;3 6)
@yiyus no, but it kind of works in oK (albeit not a table):
t: ([a: 1; b: 2]
    [a: 3; b: 4]
)

#t    / 2
@yiyus nice. do the col headers need to be symbols? eg:
t: `a`b!/:(1 4;2 5;3 6)
@chrispsn: yes, they are symbols. sorry, the backticks got lost in formatting
 
2 hours later…
03:31
Any suggestions on how to structure community docs?
I set up a page here: k7contrib.gitlab.io/docs
only the table one is there at the moment - ideally the docs would show on the same page rather than loading a new one (frames?)
can be updated here: gitlab.com/k7contrib/docs
wasn't sure if a wiki was a better way to go
but gitlab seems sensible given that's where shakti is
any thoughts?
It doesn’t really work for mobile
also wasn't sure what to call the group given shakti seems to be using k7 as the foundation but providing more familiar layers on top of it so you don't need to use k syntax (see eg groups.google.com/d/msg/shaktidb/etsXDI9J4o4/HmefTXyBAwAJ)
anyway - idea is that the docs are a clickable version of the k quickref
 
4 hours later…
08:06
The docs look nice. What I want to do, is one line per verb/type, like:
!n enum: !3 / 0 1 2
!l odometer: !2 3 / (0 0 0 1 1 1;0 1 2 0 1 2)
!d keys: ! [a:1;b:2] / `a`b
and so on... because the verbs are so heavily overloaded which is not clear from the overview
@ktye agree - maybe the docs can be anchor links on a main page instead of separate pages, which would reduce frictions for making lots of small examples like that
i'll tweak
 
2 hours later…
 
2 hours later…
11:51
@ktye these are now added
12:25
in ok, over and scan does not work with dicts:
+/ [a:1;b:2] returns 3 in k4 and k7
+\ [a:1;b:2] returns 3 in k4 but [a:1;b:3] in k7
Again: ngn anticipated this!
ngn
ngn
@ktye k4 doesn't support [] syntax for dicts, use `a`b!1 2 instead
@ngn you are right. but it does not return an error either!
ngn
ngn
@ktye why an error? reduction works on the values of a dict. scan scans the values and preserves the keys
@ngn i mean, k4 does not return an error, if you type [a:1;b:2]
ngn
ngn
@ktye it assumes it's a function application +/ [a:1;b:2] ←→ (a:1) +/ b:2
12:38
@ngn and the brackets alone? They are applied to what? [a:5;b:6] is no error but assigns the variables a and b
@ngn ok. Blocks for k3 and k4, but for kona it's a syntax error.
@ngn it wasn’t clear to me from that conversation why blocks are useful - it helps reduce the need for newline hacks?
ngn
ngn
@chrispsn yeah, for example if you want to do if(a){b;c;}else{d;e;} in k4, you could write it as $[a;[b;c];[d;e]] instead of resorting to hacks like $[a;if[1;b;c];if[1;d;e]]
@ngn ah, got it - thanks
 
2 hours later…
14:32
@chrispsn `a key [a:4 5 6;b:3 4 5] but select statements seem completely broken as of now.
 
1 hour later…
15:38
 
2 hours later…
ngn
ngn
17:08
@chrispsn i can't believe a.w. is posting on a public forum, lol
@dzaima is that k7? it could be that the a.b syntax requires a's values to be a generic list, like in k4
or it could be a bug... idk
ngn
ngn
@dzaima oh, that is serious! i think you should let them know
and does it really print dicts like that?!
@ngn [a:1] prints as-is, but more than 2 keys seem to print like that
ngn
ngn
like in q - bad
 
1 hour later…
19:58
what's the k equivalent of the APL compression (1 0 1 0 1/2 3 5 7 11)?
2 3 5 7 11[&1 0 1 0 1]?
ngn
ngn
20:24
@rcabaco yes. 2 3 5 7 11@&1 0 1 0 1 is a byte shorter, if that matters
that's nicer. thanks
it's unfortunate (for me at least) that Dyalog APL has been going with OOP instead of dfns for the tools they make
ngn
ngn
@rcabaco what do you mean? dfns are there to stay, as far as i'm aware
i was looking at their tools (conga, HTMLRenderer, etc..) and it's all OOP
i should say, OOP a traditional control structures.
s/a/and
ngn
ngn
@rcabaco well, i prefer dfns too but there's not much we can do about other people's coding habits
20:40
true.
ngn
ngn
if you mention it to Adám, he might be able to convey it to the dyalog team
i just commented from a novice's standpoint.
ngn
ngn
i don't even consider control structures and oop to be apl
they don't fit into the core language
@ngn sometimes i like to think of Dyalog being 2 parts - the calculation APL and OOP & control structures as a system to utilize APL
in the context i was writing, it makes it harder to learn APL from their code
20:52
@rcabaco imo HTML is better off being represented as OOP as it, well, is. idk about conga though, but from the little i've scrolled trough the docs it seems reasonable (though i haven't looked at the sources)
@dzaima you might be right. Perhaps it's just my self-inflicting programmer years kicking in.
and there are plenty of resources out there to learn from.
when i heard oop I expected a couple dozen files but no, and just 6 classes! the code may be using :if and other constructs a lot, but there's really no other non-hacky way to do ifs
True. But then you lose the choice of not using classes, subclasses, method overriding, etc.. once you use it. At least i did not find a way not to.
@rcabaco i really hate the argument of "if X exists, you must abuse it" sure, you can use OOP for a lot of things, but imo it should be pretty easy to tell when oop is better and when dfns/pure APL is better
21:09
I agree with you. Again, i just commented on the context of learning APL by reading code. I am quite sure they know much better what is the right approach.
@rcabaco my learning of apl didn't involve reading code, so sadly i can't relate
may i ask how you learned?
@rcabaco my own experimentation, these lessons, and the thing i feel most pushed me towards thinking more APLy - writing my own implementation
thank you for the link to the lessons
also answers on PPCG are sometimes well explained and may push the boundaries of ones knowledge of the built-ins, and the APL orchard is a great place to ask for help & ask questions

« first day (23 days earlier)      last day (1512 days later) »