« first day (768 days earlier)      last day (1876 days later) » 

12:05 AM
1
 
@nathanrogers And ≢⍴args?
 
I just got rid of the ↑ and trying to treat it as a table
I was treating it as a table to get columns of data for filtering out rows
but for this portion it was just easier to get rid of the mix and put it where I need to get columns
ok
no
@Adám no this isn't working still
now I'm still winding up with a single result and because of this now it's indexing into the vector instead of treating the vector as a scalar
even though I'm boxing it?
f returns (⊂ val1 val2)
 
@nathanrogers the vals are what shape and depth?
 
they're indexes I need
just ints
they're indexes I need to pair so I can call a function with the objects in those indices
 
@nathanrogers And what kind of argument does f take?
 
12:16 AM
the length of the the object containing the filters
I'm trying to create some sort of map, but the map isn't straight forward, the values can be one or many
 
@nathanrogers So f takes a scalar and returns an enclosed two-element vector?
 
and then, I need to filter the list containing the objects I'm mapping so that they get removed if found
f takes a vector of indices
⍳⍴args
oh yes it takes a scalar
sorry
f ¨ vectorOfScalars
so yes f takes a scalar
and returns an enclosed 2 element vector
 
@nathanrogers OK, then f¨vectorOfScalars should return a vector of enclosed two element vectors. That seems like one layer too much.
 
I don't follow
 
E.g. returns (⊂1 2)(⊂3 4) a.k.a. (⊂⊂1 2),(⊂⊂3 4)
 
12:20 AM
I mean, I'm just trying to figure out how to get it to work for 1
 
Then when you mix it, it just removes the outer scalar enclosures instead of mixing the innermost vectors into a matrix.
@nathanrogers Try redefining f so it takes a scalar and returns a two element vector.
 
look
here's a for instance
for my case f is returning 1 2
that's it
that's a problem
because if it's multiple values it would look like
(1 2) (3 4)
and mixing 1 2 just gives me 1 2
whereas mixing (1 2) (3 4) gives me
1 2
3 4
that's an issue
 
@nathanrogers Try applying f¨,⊆
 
but.... I'm just eaching over the indices of the args
so I can map the index to the index of the other thing
maybe I need to result←⊆f¨⍳...
 
@nathanrogers In that case, ,⊆f¨⍳
But it sounds to me that your arg is defective. E.g. if it is a scalar, then ⍳⍴arg returns a scalar, and then returns a scalar, and then simply discloses.
 
12:29 AM
if I see in the debugger 2 1 and it says "readonly nested array" I think that's what I want right?
i mean
how can my arg be defective?
it's a list of numbers
 
@nathanrogers Don't trust the debugger to tell you anything about numeric arrays. Use ⎕SE.Dyalog.Utils.repObj or get the shape and depth.
 
@Adám if I have a function that goes like this
{ ⎕←'1' ⋄ ⎕←'2' ⋄ ⎕←'3' ⋄ do stuff }
and I get a length error, but all 3 things print out
where is the length error happening?
 
@nathanrogers In the "do stuff".
 
12:48 AM
@nathanrogers Useful function: WhatIs←{⎕IO←0⋄∊('uneven max-'/⍨0>≡⍵)('simple' 'simple'('depth-',⍕|≡⍵)⊃⍨2⌊|≡⍵)' '('char' 'bit' '⎕AV' 'int'⍬'float' 'pointer' 'dec'⍬'complex'⊃⍨10|⎕DR⍵)' ','scalar' 'vector' 'matrix'('D array',⍨⍕≢⍴⍵)⊃⍨3⌊≢⍴⍵}
 
WhatIs 'That for?'
 
      WhatIs 2 2 3⍴⊂,2.3
depth-2 pointer 3D array
      WhatIs 2 2⍴# 4
simple pointer matrix
      WhatIs 'That for?'
simple char vector
 
hmm
WhatIs 'up doc'
 
 
1 hour later…
2:01 AM
@Adám you still around?
when using dyadic ⍳ do I want to compare if the result is < or ≤
nevermind found my bug already
 
3:03 AM
@ngn @Sherlock9 code and explanation up! codegolf.stackexchange.com/questions/75702/…
 
 
3 hours later…
5:36 AM
@voidhawk Bounty set.
 
@Adám Awesome, thanks!
 
 
1 hour later…
7:06 AM
⎕←3,/⍳10
 
@voidhawk
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬──────┐
│1 2 3│2 3 4│3 4 5│4 5 6│5 6 7│6 7 8│7 8 9│8 9 10│
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴──────┘
 
Just learned about reduce N-wise, seems useful
 

« first day (768 days earlier)      last day (1876 days later) »