Oleg Kobchenko wrote:
> Possbibly, writers using different code layout conventions
> had their reasons. It would be good to hear them.
I did not add extra spaces within explicit definition and pack as much as
possible on one line if there is no chance to break it into several lines, so
that it looks like (beware of possible line wrap)
spath_z_=: 3 : 0
if. _1-:z=. 4!:4<'y' do. y return. end. NB. bail out if not in a script
NB. count upward path elements
if. '.'~:{.y=. jhostpath y do. c=. 0 else. c=. -('..',PATHSEP_j_) +/@E. y end.
p=. ; c }. (<;.2~ =&PATHSEP_j_) jhostpath z{::4!:3''
p , (-c*3) }. y NB. get path and drop upward elements
)
0. more natural (this is irrational)
1. shorter vertical length
2. maximise horizontal width (one liner)
3. use beginning of line as search pattern
--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm