Help says that it returns the seconds to execute the "sentence y". So, what
is a J sentence? I couldn't find it in help right now, but it is a literal
string of J words. Well, that's not completely correct, but good enough for
here. If you look at the example for Time in help you will see that the
thing to execute is in quotes.

[x] 6!:2 y *Execute*. Seconds to execute sentence y (mean of x times with
default once). For example:

   a=:?50 50$100
   6!:2 '%.a'
0.091
   10 (6!:2) '%.a'          NB. Mean time of 10 executions
0.0771
   ts=: 6!:2 , 7!:2@]       NB. Time and space
   ts '%.a'
0.08 369920


On Wed, Jul 6, 2011 at 7:01 AM, David Vaughan
<[email protected]>wrote:

>
> Hmm, this is contrary to examples I have seen. Is it new in the language?
> In the language references, for example in re !: section, it says to do this
> for execution time:
>   6!:2 y
> It doesn't say you need the single quotes. An I missing something or do the
> help pages need updating?
>
> Thanks for your help.
> ___________________________
>
> David Vaughan
>
> On 6 Jul 2011, at 13:29, Don Guinn <[email protected]> wrote:
>
> > Monadic ;: takes literal arguments. Convert the results to character.
> >   ;: ": 1 2 3 + 4 5 6
> > +-----+
> > |5 7 9|
> > +-----+
> >
> > It boxes J words or tokens, close, but not quite English words. In this
> case
> > "1 2 3" is a single word in J.
> >   ;: 'The result is ' , ": 1 2 3 + 4 5 6
> > +---+------+--+-----+
> > |The|result|is|5 7 9|
> > +---+------+--+-----+
> >
> > 6!:2 executes literals. Put the calculation in quotes.
> >   6!:2 'p:1000000'
> > 0.000152044
> >
> > On Wed, Jul 6, 2011 at 4:10 AM, David Vaughan
> > <[email protected]>wrote:
> >
> >> Hi,
> >>
> >> I'm new to J and just installed the 7.01 64-bit MAC version, and a lot
> of
> >> commands are working, but some are giving me domain errors, even though
> I'm
> >> copying the sentences from one of the books.
> >>
> >> Some examples that give me a domain error:
> >>  ;: 1 2 3 + 4 5 6
> >>
> >> As I understand it, that should put all the words into boxes.
> >>
> >> Another example is the time stuff:
> >>  6!:2 p:1000000
> >>
> >> Do I need to change some paths of things, or is my install corrupt/this
> >> particular version broken?
> >>
> >> Thanks in advance.
> >> ___________________________
> >>
> >> David Vaughan
> >> ----------------------------------------------------------------------
> >> 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