I guess it will be simpler to convert a singleton into a scalar and
then let J to perform the extension, because a scalar agree with
all shapes in prefix agreement.

B + {.@,A

this works even if A is already a scalar.

Вск, 02 Сен 2012, Linda Alvord писал(а):
> I finally think I know what I don't know. I want to turn "table" A into a
> scalar (which it happens to look like).
> 
>     A
> 4
>    $A
> 1 1
>    B=:3 5 7
>    A+B
> |length error
> |   A    +B
>    (,A)+B
> |length error
> |   (,A)    +B
>    (,3$A)+B
> 7 9 11
>    (,($B)$A)+B
> 7 9 11
> 
> It feels wrong to have to do things like this every time I want to use the
> result of a previous computation called  A .
> 
> Linda
> 
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda Alvord
> Sent: Saturday, September 01, 2012 7:26 PM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Scalar to Vector - Yet again
> 
> I wasn't thinking.  A isn't a scalar. I even knew it had shape 1 1 .    
> 
>     A
> 4
>    $A
> 1 1
>    $3 2
> 2
>    2$A
> 4
> 4
>    3 2 + ,2$A
> 7 6
>    
> This works!  Thanks.
> 
> Linda
> 
> -----Original Message-----
> From: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of km
> Sent: Saturday, September 01, 2012 6:10 PM
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] Scalar to Vector - Yet again
> 
> ,4 is a vector
> 
> Sent from my iPad
> 
> 
> On Sep 1, 2012, at 4:56 PM, "Linda Alvord" <lindaalv...@verizon.net> wrote:
> 
> > I vow to remember how to do this, and several months later I forget 
> > and can't find it
> > 
> > anywhere.  Is there some way to get to the example from the vocabulary
> page?
> > Maybe I can remember that.
> > 
> > 
> > 
> >   A=:1 1$4
> > 
> >   3 2 + A
> > 
> > |length error
> > |   3 2    +A
> > 
> > 
> > 
> > Thanks.
> > 
> > 
> > 
> > Linda
> > 
> > ----------------------------------------------------------------------
> > 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

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to