Thanks, the reason why it happens is an issue that often makes beginners
and non-beginners to scratch their heads.  The names u and v (and m, n, x,
and y) are special names having particular meanings within an explicit
definition (run1_lab_, in the case that we are entertaining).

It seems, but I am not so sure, that a solution to my own question is to
define, for example,

runimmex1=: 3 : 0
IMMEX=: y
9!:27 '0!:111 IMMEX_jlab_'
9!:29 [ 1
)

in between the runimmex and run1 verbs and replace the (apparently only)
instance of run1 by runimmex1.  Thus, running the modified lab now produces,

   2+3
5
   x=: 2
   y=:3
   x+y
5

   u + v
u + v

I was hoping that there was an easy way (for instance, setting a flag noun
in the body of the lab).

Why would one like to have a faithful direct execution of the sentences of
some labs?  One reason is to write a lab (Special names) illustrating why
it is a very good practice to use the special names only within the context
of explicit definitions (unless one is prepared to avoid explicit
definitions all together!).  If one tries to use the current version of the
labs, one falls victim of the same issue that one wants to illustrate!  I
have my own reasons: I use freely all the special names ;)



On Thu, Sep 10, 2015 at 7:22 PM, Raul Miller <[email protected]> wrote:

> I do not know why this happens.
>
> The relevant code here appears to be run1_jlab_ which uses 0!:111
>
> But
>    0!:111 'x=:2',LF,'y=:3',LF,'x+y',LF,'u+v',LF
> does not give the value error, while
>    run1_jlab_ 'x=:2',LF,'y=:3',LF,'x+y',LF,'u+v',LF
> does give the value error.
>
> Maybe it has something to do with the locale? This might be a bug in
> the interpreter?
>
> Thanks,
>
> --
> Raul
>
> On Thu, Sep 10, 2015 at 6:12 PM, Jose Mario Quintana
> <[email protected]> wrote:
> > Talking about labs, is there an easy way to run (all the sentences of) a
> > lab in immediate execution mode?  For example, if I insert the sentence
> 'u
> > + v' in the 'A J Introduction' lab after 'x+y' and run the lab from a
> > scratch session I get:
> >
> >    x=:2
> >    y=:3
> >    x+y
> > 5
> >
> >    u+v
> > |value error: v
> > |   u+    v
> > |[-5]
> >
> > But if I type directly 'u+v' directly in the session I get:
> >
> >    u+v
> > u + v
> >
> >
> > I would like this and similar sentences in the body of a lab to exactly
> > match the direct session behavior.  Is there an option, easy trick, etc.
> to
> > accomplish this?
> >
> >
> > On Thu, Sep 10, 2015 at 2:32 PM, Devon McCormick <[email protected]>
> wrote:
> >
> >> There does seem to be a wide range of opinion on the usefulness of the
> >> labs, but I'm glad to have them around, wherever they're hiding.
> >>
> >> On Thu, Sep 10, 2015 at 2:16 PM, Dan Bron <[email protected]> wrote:
> >>
> >> > Ian wrote:
> >> > "Normal use" for me invariably means referring to sample code.
> >> > > Especially when using addons, i.e. all the time.
> >> >
> >> >
> >> > Funny what constitutes “normal use” for different people!
> >> >
> >> > I may have opened the Labs in my first few weeks of using J (was that
> >> > 2001? wow.), but I haven’t since.
> >> >
> >> > I don’t find the interactive/pagination workflow of Labs conducive for
> >> > reference material. It’s tutorial material. I believe the intended use
> >> case
> >> > for Labs is you go through any given Lab once or twice, but once you
> >> > internalize the lesson, you put it on the shelf.
> >> >
> >> > For reference material, i.e. “normal use” for me, I use the
> Dictionary,
> >> > Wiki, and Forum search tool, supplemented by  open’scriptname’  where
> >> > needed (though sadly we’re missing  edit’functioname’ from the good
> old
> >> > days).
> >> >
> >> > -Dan
> >> >
> >> > ----------------------------------------------------------------------
> >> > For information about J forums see
> http://www.jsoftware.com/forums.htm
> >> >
> >>
> >>
> >>
> >> --
> >> Devon McCormick, CFA
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> 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