« first day (855 days earlier)      last day (680 days later) » 

2:01 AM
@ngn do you have any deep where test cases? can't see any here
 
2:28 AM
ah i see - the type system doesn't know that the keytable isn't shallow (all dict are type m) so deep where doesn't know it should keep digging...
 
ngn
@chrispsn i don't have any yet
@chrispsn keytables are still a mystery to me
@chrispsn added one
 
ngn
2:55 AM
@Traws fixed. i%i returns a float now.
@chrispsn deep where could work for tables too
 
@ngn thanks!
 
@ngn yep - here's where i'm up to:
key:{!$[`m~@x;x;#x]}
where2:{$[~^`A`M?@x
          (,key[x]@&(#+:)'s),,'/s@\\:!0|/#'s:o'x  / prev deleted s@\\:!0|/#'
          ,&x]}
goal should be that (x'). deepwhere y always works
being able to encode a snippet in a url and paste so others can run in the browser is so handy
 
ngn
3:13 AM
@chrispsn should there be a requirement for x to be unirank?
 
@ngn we could start there
feels like the ragged case is less important
but should be an aspirational goal
i had an idea for a 'flippy' function that turned an arbitrarily nested structure into a flat dict comprising a deepwhere-looking output as domain and the flat values as range, and back
and maybe stops along the way (eg strings as values and domain length is one shorter)
kind of like the rank operator
'explode/implode' sounds cool
 
ngn
interesting
 
and maybe the implementation actually stores nested structures in the 'exploded' form and just provides the 'imploded' nested form as a convenience
don't know if any of that would be useful
but the point is, if you had that, then 'deep where' is just a regular shallow & on the exploded form
and more generally - depth and shallow forms of verbs are unified. you instead have a 'toggle' verb that you can apply at will to determine whether an operation should be shallow or deep. or maybe an adverb
sort of like how k9's ? on dicts, exchanging domain and range, lets you deal with domain/range targeting via a data structure manipulation instead of a different kind of verb
so no more shallow @ and deep dot. indexing is always shallow and it's up to you to implode or explode as necessary
 
ngn
3:39 AM
@chrispsn only flipped (with respect to our current implementation)
 
@ngn yes. One potential performance issue
 
4:17 AM
Maybe that would be a reason to make it an adverb. Implicit 'under' for the flip and explode/implode conversion
 
4:30 AM
That might eliminate other primitives too. 'Odometer' as just 'deep range'?
 
4:59 AM
Equality is probably 'deep match'
You want to reshape? Strap an odometer result to the 'range' vector via 'dict' and implode
 
5:32 AM
i guess the point/insight of k is that you don't need this level of generality - certain verbs tend to be used with certain ranks more than others (infinite (equality); leading (filter); entire data structure (flip))
 
 
4 hours later…
9:27 AM
here's a starting point for explode, a deep where that works on ktables, and a deep group thrown in just because. explode is powerful
maybe a simpler way to explode would be starting with !/++(values;,()) and then build the keys by prepending to the lists. then swap the dict at the end
@ngn if dict[] gave values instead of 0N it would eliminate the val helper in the above
 
 
4 hours later…
1:43 PM
how do i get only the values of a dict??
 
@Razetime .
 
huh.
 
(found by searching "values" in \+)
 
whats \+
 
@Razetime the verb help page in ngn/k. you can enter it in the REPL
 
1:47 PM
(on the beginning of a line)
 
hm, the oK manual needs that then
or maybe i missed it
 
oK doesn't have that in its repl because it has an actual manual
and it does have \h, like it says on startup
 
nah the mention of . giving values of a dictionary
* is mentioned to give first value
! gives keys
but . needs a mention
 
 
1 hour later…
2:58 PM
deep where allows this small tacit odometer ngn.bitbucket.io/k/#eJxLs1JTjrY2jHXg4kpTMFIwVjABACcEA8E=
 
nice
 
3:43 PM
@Traws that's neat, and it can even be tweaked to generate patterns/subsets of the full odometer result
 
4:16 PM
@ngn if I do (𝍪:):{(&#'x)@<,/x};𝍪=20?10 I get a segfault (if I use a name for the function instead it works)
 
 
2 hours later…
 
2 hours later…
7:39 PM
@ngn is there a reason why mod in ngn/k takes the left argument as the divisor (instead of the right argument as divisor)?
as far as i understand klong and kona have it the other way round
ah, also in shakti, I found this
https://groups.google.com/g/shaktidb/c/5XCgF8gTMPI/m/yaNm6-OdBAAJ
behaves like | in APL (residue)
 

« first day (855 days earlier)      last day (680 days later) »