       Re: Use of delayed assignment, :=, with a list

• To: mathgroup at smc.vnet.net
• Subject: [mg91781] Re: Use of delayed assignment, :=, with a list
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Sun, 7 Sep 2008 22:53:46 -0400 (EDT)

```On 9/7/08 at 5:35 AM, PHILLMAN5 at gmail.com (phillman5) wrote:

>I use simple 2x2 matrixes for each item in a optical train to get
>the over all 2x2 matrix. The four elements are a, b, c, d, and I can
>assign them easily in one step.

>{{a, b},{c, d}} = any  2x2 matrix

>however some times the rhs has variables, so I'd like to use an
>delayed assignment

>{{a, b},{c, d}} := any  2x2 matrix

>this does not work, Mathematica says the two lists are not the same
>shape.  In particular:

>{{a, b},{c, d}} := {{1, zomeasure}, {-(1/f), 1 - zomeasure/f}}

>where f and zomeasure are variables (maybe not even defined yet).
>Mathematica says the lists are not the same shape,

Are you sure you don't have something previously defined? I just
pasted the code above you say doesn't work into a fresh session
and it seems to work fine. That is:

In:= {{a, b}, {c, d}} := {{1, zomeasure}, {-(1/f),
1 - zomeasure/f}}

Out= ({Null,Null},{Null,Null}}

In:= a

Out= 1

In:= b

Out= zomeasure

In:= c

Out= -(1/f)

In:= d

Out= 1-zomeasure/f

```

• Prev by Date: Re: ListDensityPlot with Axes, Ticks, TicksStyle
• Next by Date: Re: Re: phase-space versus controlling parameter surface
• Previous by thread: Re: Use of delayed assignment, :=, with a list
• Next by thread: Re: Use of delayed assignment, :=, with a list