a=:1 (a=:1) 1 ]a=:1 1 The assignment statements are special, in several ways. One way they are special is that they treat a name as the spelling of that name rather than the value of that name. Another way they are special is that when an assignment statement is the last step in an evaluation of a sentence the result of that sentence is not displayed.
But when it's put in parenthesis, it's not the last step in the evaluation of that sentence. Does that help? Thanks, -- Raul On Mon, Sep 16, 2013 at 12:43 PM, Brian Schott <[email protected]> wrote: > Coincidentally I was trying just what you suggested using Roger Stoke's > fine EVM on 'test=: +: ifC ' and '(test=: +: ifC)' when your message came > in. > > For example I executed the following (the adjustment is to narrow the wide > output). > > '( test=: +: ifC )' EVM > (20&{.,100&}.)"1 hist'' > ' test=: +: ifC' EVM > (20&{.,100&}.)"1 hist'' > > The main difference in the results was that extra finishing steps were > required to process the outside parens. But I still do not understand why > the parenthesized version produces output. > > > On Mon, Sep 16, 2013 at 12:10 PM, Raul Miller <[email protected]> wrote: > >> It's easier to answer questions like this if you quote the specific >> code you are referring to. (I could try answering, but what if I >> guessed wrong (about what confused you)? I'm something of a >> perfectionist and sometimes that means that the slightest issue >> distracts me onto something else.) And, believe me, I've plenty of >> other things to distract me! :) >> >> That said, if you want to try answering these questions for yourself >> (instead of encouraging the j community to perhaps talk about them), >> you could try running the expressions through trace, both with and >> without the parenthesis. >> >> Thanks, >> >> -- >> Raul >> >> >> >> >> >> On Mon, Sep 16, 2013 at 11:27 AM, Brian Schott <[email protected]> >> wrote: >> > Twice now in this thread, parentheses have made a serious difference in >> > results. If that difference has been explained I have missed it and would >> > appreciate an explanation. >> > >> > In Pascal's message parens were need around the explicit definition of an >> > adverb. >> > >> > In Jose' s (Pepe's?) message the parens were used as follows and >> different >> > results are produced without parens. >> > >> > st=. 7!:2@:] ; 6!:2 >> > >> > NB. Explicitly... >> > >> > controlA_z_ =: 1 : 0 >> > flag1_z_ =: 1 >> > o=. u y >> > flag1_z_ =: 0 >> > o >> > ) >> > >> > ifC=: 1 : 'if. flag1_z_ do. u y else. y end.' >> > >> > ( test=: +: ifC ) >> > >> > >> > >> > -- >> > -- > (B=) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
