Well, for compensation I can show you one of my blind spots.

A simple function f like
   f =. 3 5&*
behaves as:
   f 4 9
12 45
   f i. 2 5
 0  3  6  9 12
25 30 35 40 45
and I like that.

But, for example, 
   g =: (+/) , -/
behaves differently:
   g 4 9
13 _5
   g i. 2 5
5 7 9 11 13 _5 _5 _5 _5 _5
To get f's behaviour, in terms of output shapes, I use:
   g =: |: @: ((+/) ,. -/)
Now
   g 4 9
13 _5
   g i. 2 5
 5  7  9 11 13
_5 _5 _5 _5 _5

But somehow this doesn't feel right. What am I missing?

Ben
________________________________________
From: [email protected] 
[[email protected]] on behalf of R.E. Boss 
[[email protected]]
Sent: Tuesday, January 27, 2015 14:24
To: [email protected]
Subject: Re: [Jprogramming] Behead along all axes

I feel embarrassed.
Thnx.


R.E. Boss


> -----Original Message-----
> From: [email protected] [mailto:programming-
> [email protected]] On Behalf Of Ben Gorte - CITG
> Sent: dinsdag 27 januari 2015 13:39
> To: [email protected]
> Subject: Re: [Jprogramming] Behead along all axes
>
> Why not
>  <"(2) 1 1 1 1 }. i.3+i.4
> ?
> (or am I missing something?)
>
> Ben
> ________________________________________
> From: [email protected] [programming-
> [email protected]] on behalf of R.E. Boss
> [[email protected]]
> Sent: Tuesday, January 27, 2015 12:48
> To: [email protected]
> Subject: [Jprogramming] Behead along all axes
>
> My solution is ( <"2 is for presentation reasons)
>
> <"2 ({~[:< [:}.L:0 [:<@i."0 $) i.3+i.4
> +-------------------+-------------------+-------------------+
> |157 158 159 160 161|187 188 189 190 191|217 218 219 220 221|
> |163 164 165 166 167|193 194 195 196 197|223 224 225 226 227|
> |169 170 171 172 173|199 200 201 202 203|229 230 231 232 233|
> |175 176 177 178 179|205 206 207 208 209|235 236 237 238 239|
> +-------------------+-------------------+-------------------+
> |277 278 279 280 281|307 308 309 310 311|337 338 339 340 341|
> |283 284 285 286 287|313 314 315 316 317|343 344 345 346 347|
> |289 290 291 292 293|319 320 321 322 323|349 350 351 352 353|
> |295 296 297 298 299|325 326 327 328 329|355 356 357 358 359|
> +-------------------+-------------------+-------------------+
>
> Any elegant alternatives?
>
>
> R.E. Boss
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to