Re: Sum of terms --> list

*To*: mathgroup at smc.vnet.net*Subject*: [mg127213] Re: Sum of terms --> list*From*: Dana DeLouis <dana01 at me.com>*Date*: Sun, 8 Jul 2012 19:06:28 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net

> LB[z_] := List @@ B[z] > LB[3] (* NOT OK*) > LB[3] gives 11/3 - this is a sum of term again - why ? Hi. I believe B[3] is evaluated first to 1/(2-3) + 3/(4-3) + 5/(6-3) Which is immediately reduced to 11/3. Then the function -List- is applied to this reduced form, which returns just 11/3 One needs to hold the evaluation, or perhaps just: B[z_]:=1/(2-z)+3/(4-z)+5/(6-z) LB[z_]:=(List@@B[#1]) /. #1 -> z LB[x] {1/(2-x), 3/(4-x), 5/(6-x)} LB[3] {-1, 3, 5/3} = = = = = = = = = = HTH :>) Dana DeLouis Mac & Math 8 = = = = = = = = = = On Jul 7, 5:31 am, b... at ANTYSPAM.ap.krakow.pl wrote: > I have found this thread, an I heve additional question about List@@ > > see on example: > > ---------- > ClearAll["`*"]; > B[z_] := 1/(2 - z) + 3/(4 - z) + 5/(6 - z); > B[z] (*OK*) > LB[z_] := List @@ B[z] > LB[z] (*OK*) > LB[z] /. z -> 3 (*OK*) > > LB[3] (* NOT OK*) > ------------------------ > > LB[3] gives 11/3 - this is a sum of term again - why ? > Is a simply way to convert B[z] ---> LB[z] > where LB[z] is a list of simple functions of z ? > > greetings, Olaf