« first day (890 days earlier)      last day (645 days later) » 

1:34 AM
k4 returns the same value as ngn/k
oK returns 1 1!3 2
looking at the output of either, it's not obvious to me how the various implementations arrive at those values. curious to hear what's going on
 
 
2 hours later…
3:19 AM
@scrawl here is oK's implementation of dict,dict: github.com/JohnEarnest/ok/blob/gh-pages/oK.js#L117
duplicate x, iterate over the keys of y setting x[yk]:yv
the confusion you're getting is probably because I iterate over keys, and use dget() to retrieve the keys, so both times I get the first binding for the value
it would be possible to tweak this to iterate over key/value pairs but if you're using denormal dictionaries on purpose it's sort of a "play stupid games, win stupid prizes" scenario
an argument could potentially be made that the make-dict operator ought to squash denormal dictionaries together into proper dictionaries; it's a more expensive operation, though
 
 
5 hours later…
8:01 AM
@coltim how's this? {$[x;!,/(,'x)!'x;x]} tests
i note there's no grade or sort in k tech tree yet
kelas had a nice quicksort implementation here
 
 
2 hours later…
ngn
9:47 AM
@ktye fixed, thanks
 
ngn
10:15 AM
@Traws @scrawl think of it as an amendment - each key-value pair from the second dictionary overwrites the first seen matching key and its corresponding value in the first dictionary
 
 
4 hours later…
2:24 PM
@chrispsn it doesn't seem to like nested lists (b/c of a length error that can be worked around with {$[x;(,'x)!','x;x]}) but I think there's a segfault (@ngn) when razing a bunch of nested dicts of different sizes/ranks or something, e.g. ,/((,,7)!,,7;(,,7)!,,7;(,(1 2 2;2 3 3))!,(1 2 2;2 3 3))
 
 
1 hour later…
ngn
3:25 PM
@coltim smaller repro: (`a!0),(,,`b)!1
this probably has something to do with the rank sensitivity of find
 
interesting that k4 just throws a 'type error when joining dictionaries of different ranks (or at least on that specific example)
(I imagine joining dictionaries of different ranks falls into the "play stupid games, win stupid prizes" category)
 
@coltim is the "upsert" you mentioned the current behavior in k4 and ngn/k or is it something else?
 
3:41 PM
@Traws both - (k4/q doc link)
@chrispsn I think this is cute
 
ngn
4:16 PM
@ngn oh, hang on.. this is just my stupidity. i've fogotten to let the error through in the function that handles dict amendments
@coltim works now, though the result may look a little strange
 
@ngn hmm, 'idx on the ,/?
 
ngn
@coltim yeah, but idk why the web version doesn't print it
 
@ngn I had to do a Ctrl+F5 to get it to show up
 
ngn
ah.. :)
thanks
 
4:33 PM
@ngn, what do you think of eval working recursively on a parse-tree ?
 
ngn
@Traws . is more like apply than eval
@Traws does any other k impl do that?
 
@ngn k7
 
@ngn . string tho
 
ngn
@Traws strange. k9 doesn't.
@coltim right, . string is more like eval (or parse+eval)
 
having some mechanism to eval a nested parse tree would be fun
 
4:48 PM
to me it seems more useful.. but of course I'm not considering the implementation details and performance impact
@coltim yep, because we have `p to get the parse tree but don't have the counterpart of evaluating it
it could be also a symbol like `p if not .
 
hmm what if .str was just parse, and .non-string-list was eval?
 
 
2 hours later…
6:50 PM
i have tokenize: `t"str", parse: `p toks or `p"str" and value: ."str" or .code. the result of `t is a flat list of tokens, and of `p a flat list of code points.
 

« first day (890 days earlier)      last day (645 days later) »