> From: Raul Miller
> 
> pad=: adverb define
>  adj1=: <.m%2
>  adj2=: m-1
>  (-@(adj2 + ]) {. (adj1 + ]) {. [) (#m) {. $
> )
> 
>   5 5 pad i. 3 3
[snip]
> 
> padded=:conjunction define
>   u;.n y
> :
>   x u;.n x pad y
> )
> 
> Example use
>    3 3 <padded _3 i.4 4

Raul, your proposal sounds useful to me.
 
My question is about the details of your current implementation - hoping to 
learn something!

Are there advantages of defining pad as an adverb rather than a verb? i.e. Why 
not:

pad=: dyad define
 adj1=: <.x%2
 adj2=: x-1
 ((-@(adj2 + ]) {. (adj1 + ]) {. [) (#x) {. $) y
)


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to