Hi Linda,

I think the explanation is in the fact that:

   (,1)#"1 ''
|length error
But 
1#"1 ''

works OK.

i suspect empty is not an appropriate right arg for the verb, but if you
insist, then perhaps you may need to special case it.

enjoy
ken


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: 04 October 2012 06:41
To: [email protected]
Subject: [Jprogramming] Why the length error?


        rad=: 13 :'(A=:1,-. 2-:/\|:y)#"1 y' NB. Remove adjacent duplicates

   ]B=:2 4 $3 5 5 4 2 1 1  6
3 5 5 4
2 1 1 6
   rad B
3 5 4
2 1 6
 

The verb  rad  works as expected, but suppose in an earlier step  B  has
become empty, I get a length error.  Why does this happen? 


   C=:''
   rad C
|length error: rad 
|   (A=:1,-.2-:/\|:y)    #"1 y
   A
1
   1#"1 C
  
What can I do to get an empty result?

Linda 

----------------------------------------------------------------------
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