« first day (757 days earlier)      last day (1890 days later) » 

1:07 PM
Another k7 update nsl.com/k7/unparse.k
 
 
4 hours later…
4:41 PM
Don't forget to join our live webinar today at16:00 UTC - http://dyalog.tv/Webinar. Jay Foad used Dyalog APL in Advent of Code & will talk about his approach to the contest, share tips for writing simple fast code, and show some solutions that worked out well in APL.
 
 
2 hours later…
ngn
6:33 PM
@chrispsn have you (or anyone else) managed to figure out anything from that?
 
Well it's easy to figure out that it's a bunch of K code >.>
 
ngn
@J.Sallé :D
 
Jokes apart, it's cool to see K is not dead
 
@Adám I'm having trouble with the menu scaling again
I can't delete anything from SALT
 
@ngn not yet, but note there's no Unicode symbols in sight reddit.com/r/apljk/comments/at2reu/…
 
ngn
6:49 PM
ok, so "unparse" presumably means format an object for printing in such a way that the output parses back to the same k object
the most interesting function seems w. it dispatches to other functions based on the type of the (right) arg
it also has comments - rare :)
 
ngn
7:15 PM
@ngn i was wrong. "unparse" means reconstruct the source code from a parse tree (an ast)
U is the testing function whose outputs are included at the end of the file. it's called with various strings as argument. it parses the string, then "unparses" and compares with the original. it prints "original -> parsed-unparsed" and prepends a "*" if they don't match
it's amazing k7 uses `p@ to build an ast - exactly the same as ngn/k
 
ngn
8:12 PM
the code makes a lot of use of this golfing trick: f[x;y] -> f[x]y
now this is a rather verbose way to join a list of strings with spaces: 1_,/" ",' (in function v). doesn't k7 have " "/ ("join")?
 
8:29 PM
@ngn did you notice any differences to the current version of K?
 
ngn
@ktye a few small ones, nothing drastic
but do we know this is really k7... ?
@ktye @x returns symbols. previously it returned ints
`p@x parses a string into an ast (afaict). previously it was (-n)!x for some integer n (i can't remember exactly)
`k@x does something... i haven't figured out what yet
there are indirect signs of other things having been changed or removed - like " "/, but we can't be sure whether it's due to a change or the author just chose the more verbose expression for another reason
also: " "=x could have been ^x, or maybe the meaning of ^ was changed again
the use of o as an identifier shows that it probably no longer means "recur"
 
@ngn either great minds think alike or open source ftw
in any case, nice!
 
ngn
8:48 PM
@J.Sallé i was aware that more `symbol@x syntax would be coming in newer versions. i liked that, so i adopted it. then, there aren't many ways to abbreviate the word "parse" to its bare minimum
 
Great minds think alike indeed, then
 
ngn
9:01 PM
@J.Sallé another one is 1 2 3+/ (without a right arg). in both k4 and ngn/k it evaluates to 6 :) it was totally unintentional (at least in my case). i think i'm not gonna fix that bug :)
 
@ngn definitely not a bug. I call those "unintended features"
 

« first day (757 days earlier)      last day (1890 days later) »