Can't you just test it?

If you don't want to use a debugger, you can insert printf statements
or something like that to see when a point in the code has been
reached.

Or, if you prefer, I could test it.... (I stalled out, getting the
thing to compile, under OSX - but if you need the support, I should be
able to motivate myself to work through those issues).

Thanks,

-- 
Raul


On Tue, Jun 21, 2016 at 7:29 PM, Henry Rich <henryhr...@gmail.com> wrote:
> jttraverse is:
>
> static A jttraverse(J jt,A w,AF f){
>  RZ(w);
>  switch(AT(w)){
>   case XD:
>    {DX*v=(DX*)AV(w); DO(AN(w), CALL1(f,v->x,0L); ++v;);} break;
>   case RAT:
>    {A*v=AAV(w); DO(2*AN(w), CALL1(f,*v++,0L););} break;
>   case XNUM: case BOX:
>    if(!(AFLAG(w)&AFNJA+AFSMM)){A*wv=AAV(w);I wd=(I)w*ARELATIVE(w); DO(AN(w),
> CALL1(f,WVR(i),0L););} break;
>   case VERB: case ADV:  case CONJ:
>    {V*v=VAV(w); CALL1(f,v->f,0L); CALL1(f,v->g,0L); CALL1(f,v->h,0L);}
> break;
>   case SYMB:
>    {I k,*v=1+AV(w);L*u;
>     CALL1(f,LOCPATH(w),0L);
>     CALL1(f,LOCNAME(w),0L);
>     DO(AN(w)-1, if(k=*v++){u=k+jt->sympv; CALL1(f,u->name,0L);
> CALL1(f,u->val,0L);});
>    } break;
>   case SB01: case SINT: case SFL: case SCMPX: case SLIT: case SBOX:
>    {P*v=PAV(w); CALL1(f,SPA(v,a),0L); CALL1(f,SPA(v,e),0L);
> CALL1(f,SPA(v,i),0L); CALL1(f,SPA(v,x),0L);} break;
>  }
>  R mark;
> }
>
> I am interested in handling the SYMB type.  The line
>
>     DO(AN(w)-1, if(k=*v++){u=k+jt->sympv; CALL1(f,u->name,0L);
> CALL1(f,u->val,0L);});
>
> looks to me like it will traverse only the first name in each chain, which
> would leave the
> remaining names in that chain unprocessed.  I am thinking it needs to be
>
>     DO(AN(w)-1, for(k=*v++;k;k=u->next){u=k+jt->sympv; CALL1(f,u->name,0L);
> CALL1(f,u->val,0L);});
>
> I am loath to change such a basic function but I am thinking it is just
> possible that has never been executed, since assigning a symbol-table is
> rare.  Can someone who knows the code weigh in on this?
>
> Henry
> ----------------------------------------------------------------------
> 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