« first day (889 days earlier)      last day (646 days later) » 

6:32 AM
@chrispsn what is the @: in the middle doing?
 
 
1 hour later…
7:32 AM
@ktye modified assignment - like i:i@i . There's probably a way to simplify it
 
8:01 AM
@chrispsn interesting. how is the operation i@i called, if i is a permutation index? and what is i@i@i@i.. doing?
 
8:33 AM
A shuffle?
I do wonder if dicts could make the code cleaner too
 
ngn
9:18 AM
@ktye permute? :)
or self-permute? (a composition of a permutation with itself)
 
9:54 AM
@coltim @ngn btw this can now be {(x?x)=!#x}#
@coltim but yes, as far as i can tell the find-based approach is way faster than the non-find one
 
10:42 AM
@chrispsn maybe not cleaner, but: {<!/(x;i)@\:&~@[;0;0]~':x@:i:<x}
 
11:06 AM
last one: {(@[;0;:;1]@~~':x@i)@<i:<x}#
 
11:52 AM
obvious simplification {@[(~':x@i)@<i:<x;0;:;0]}_
i like this layout since it makes ordinal's role clearer
 
12:18 PM
here's an awful one
*'-1_{x^*x}\
 
12:29 PM
fwiw here's BQN's 'mark firsts' github.com/mlochbaum/BQN/blob/…
 
12:58 PM
@chrispsn I wonder if f#x could just be syntax sugar for x@&f x under the hood or something. it appears to be a decent bit slower
@coltim it also matches keys#dict/i#dict
 
1:16 PM
@chrispsn and another - {!(()!()){x,(,y)!y}/x}
 
@coltim heh, clever
 
1:45 PM
@coltim oops: {!((0#x)!()),x!x}
 
2:39 PM
@coltim how about {!,/x!'x}
 
@chrispsn quite close to working, provided the integer overloads of ! are handled. guess there is also preserving the typing of empty lists
also in some k's x!y make-dict requires x and y to be lists
 
3:01 PM
@coltim how about {!!/0,x!x}
 
@Traws ooh wow, not sure how it does it but it does handle those edge cases. I don't understand why but it doesn't seem like to like symbols =|
 
3:18 PM
@coltim ah yeah, it's because 0 mod does not work as an identity with symbols.. but {! ::'x!x} seems to work
 
@Traws ok, handles symbols and also nested lists (so long as there are no scalars)
I guess the "top-level" case of ?scalar is not how ? distinct works as it requires a list
 
4:07 PM
What does like do in K7?
 
4:17 PM
@Razetime not 100% sure but it's likely similar to k4's
 
hm
I'll add the K4 example for now
 
@coltim the previous form could be just {!0!x!x}.. anyway the idea works by applying identity to the items of the dictionary, which deletes the duplicate keys. but I guess I'm abusing a ngn/k mechanic, I don't know if this behavior is intended (@ngn). it does not work in other Ks
 
ngn
4:47 PM
@Traws not really intended, it must be a side effect of how i implemented arithmetic operations on dicts
 
5:35 PM
@ngn I also got this oom error
 
ngn
5:57 PM
"what should dict0,dict1 do" is an interesting question
 
6:14 PM
@ngn "upsert" seems to be the generally accepted version and seems sorta related to how the arithmetic ops work
 
 
2 hours later…
7:46 PM
@ngn i catenate both, key and values
 
ngn
@ktye but that could create a dict with duplicate keys
even when the args don't have duplicate keys
 
yes, it does.
 
ngn
8:15 PM
@ktye it shouldn't cost too much to redirect x,y (where both x and y are dicts) to @[x;!y;:;. y]
@Traws fixed, thanks
 
@ngn it doesnt work for me. your @[..] is also inconsistent: ngn.bitbucket.io/k/#eJxziDZUMLLWMba2sjaJ5XIA8yAcAE18BdE=
 
8:58 PM
@ngn I think I prefer to append the keys that don't collide and leave the rest intact, because this looks very strange
 

« first day (889 days earlier)      last day (646 days later) »