To clarify, your problem isn't part of the execution of $ . It occurs
during the word formation step, which is when vectors are formed. J knows
that numerics side-by-side form a list, so it will do that for you, but
with names, it doesn't even now the part of speech, so it can't. Also note
that accepting defined nouns as as part of such a list would be quite a
hassle: what if the noun is actually a one-element list? An array? Almost
any implementation for these cases would likely cause surprising behavior.
The correct solution is, as Roger notes, to build the list with verbs,
which are more flexible and powerful anyways.

Marshall

On Thu, Nov 3, 2011 at 3:13 AM, Roger Hui <[email protected]> wrote:

> master=. (datesperyear,3) $ 0
>
>
>
> On Wed, Nov 2, 2011 at 11:47 PM, PackRat <[email protected]> wrote:
> > Why does "shape" not accept assigned values, as in the following:
> >
> >   datesperyear=. 365
> >
> >   master=. datesperyear 3 $ 0  NB. this gives syntax error
> >   master=. 365 3 $ 0           NB. this does not give error
> >
> >   buckets=. datesperyear $ 0   NB. these do not give errors
> >   counts=. datesperyear $ 0
> >
> > This means I have to explicitly specify numeric values in numerous
> > places rather than use a single assigned value multiple times.
> >
> > Thanks in advance for any explanations!
> >
> >
> > Harvey
> >
> > ----------------------------------------------------------------------
> > 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