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

12:26 AM
I wonder how many instances of *| could just as easily have been *1_
K's cdr()
 
 
9 hours later…
ngn
9:52 AM
@JohnE but that's longer :)
 
 
6 hours later…
3:27 PM
from time to time I've seen caaddar() chains like *|**| in k codebases but usually it's written with indexing like x[0;0;1;0;0;1]
all in all it seems to me like a compelling argument for destructuring assignment
 
 
3 hours later…
ngn
6:00 PM
@coltim smaller repro: &*/62#2
 
ngn
6:52 PM
@coltim now it dies with an oom. there was an overflow in the check for max array size.
 
@JohnE destructing assign: i do this now: (a;b):1 (both are 1), (a;b):1 2 (both are atoms), (a;b):1 2 3 (a is 1, and b is vector 1 2).
Is that what you recommand?
@ngn you do not allow the last case (a;b):1 2 3 but the other two.
 
ngn
@ktye i think it's wrong to interpret that as a:1;b:2 3
 
@ngn wrong in what way. is an error better?
 
ngn
@ktye (a;b) is always length 2. i prefer a length error.
 
@ngn it's a shorter (and more general) form for (a;b):(*:;1_)@\:1 2 3
 
ngn
7:01 PM
@ktye under that interpretation, (a;b):1 2 should mean a:1;b:,2 (note the comma)
 
@ngn yes that's up to debate. should the last assignment be always a vector, or only if the right side is longer..
 
@ngn ahh, so the scan version works because it causes = to be group rather than unit-matrix... oops. what is the max array size limit?
 
ngn
@coltim it's "reasonable" :)
i change my mind all the time. currently 1<<40 bytes (and much lower for 32bit), iirc
@ktye splitting into head and tail should be something like ((,a),b):..
 
7:18 PM
@ngn almost reminds me of the relatively flexible APL2 style destructuring (which weirdly I don't think I've seen elsewhere)
 
ngn
@coltim yes, apl takes this to an extreme
18
A: Unflatten an Array

ngnDyalog APL, 14 characters This is a no-brainer: (∊a)←b. Normally, ∊a means a flattened, but when it occurs on the left-hand side of an assignment, it does precisely what this problem is asking for. To comply with the requirement of being a function, it needs a few extra squiggles: {a←⍺⋄(∊a)←⍵⋄a}...

^one of my most upvoted answers
 
7:55 PM
@ktye despite the discontinuity ngn points out, I think what you're doing is very useful for common tasks, like nibbling pieces off of the head of a list to parse
 

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