I wrote:
>  It is exhibited by all  f"0 y  where  0 e. $ y  (whether the  "0  is, to 
> borrow a phrase, 
>  express or implied).  Basically you're asking to operate on all the scalars 
> of an array 
>  which contains no scalars.  

For completeness, I guess I should note that  0  is not a special number here.  
 All phrases of the form  z=. f"r y  where  y  contains no r-cells will produce 
empty results (i.e.  0 e.$z  ) and hence empty displays.  An analogous 
statement is true for phrases of the form  z=. x f"(lr,rr) y  .  Again, all 
ranks here can be express or implied (the natural rank of a verb, or specificed 
explicitly using the rank conjunction).

A quick adaptation of Roger's model of the rank conjunction at:

   
http://www.jsoftware.com/jwiki/Essays/Rank#head-9912249d00fd010b059214f0e6cf59dbe3ce3801

Leads to the adverb  qr  :

           rk =:  [EMAIL PROTECTED]  
           er =:  (0:>.(+rk))`(<.rk) @. (0<:[)  
           fr =:  [EMAIL PROTECTED] }. [EMAIL PROTECTED]  
           
           qr =:  1 : 0
                'mm ll rr'=. 3$&.|.m
                (0 e. mm fr ]) : ( (ll fr [) +.&(0&e.) rr e. ] )
        )
           
which, given a rank as its argument,  m  ,  will produce a verb indicating 
whether  f"m y  or  x f"m y  will produce an empty result (ie a result without 
volume, ie an empty display)  .  The relevant call for Gosi's example is:

           0 qr ''
        1

Which indeed indicates  6!:0"0  ''  will produce an empty display.  In fact, 
the adverb can be extended to accepts verbs as arguments directly, rather than 
ranks:

           qv =:  1 : '(u b. 0) qr'
           
           6!:0"0  qv ''
        1

-Dan

PS:  Apologies if the adaptation is buggy, but I didn't want to post a cheating 
hack like  0 e. $@:(<"mm)  .

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

Reply via email to