MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Convert Products to Lists

  • To: mathgroup at
  • Subject: [mg1169] Re: Convert Products to Lists
  • From: pehowland at (Paul E. Howland)
  • Date: Sat, 20 May 1995 03:23:27 -0400
  • Organization: Defence Research Agency

In article <3p8ssc$6cr at>, bob at (Robert Zimmerman) writes:
>Is it possible to convert a product of numbers to a list of numbers.  
>but it doesn't work for numbers
>2  4  6//.Times->List
>Can it be done?

You need to wrap Hold around the numbers to prevent the evaluation of Times,
and then ReleaseHold after replacing the head. ie.

In[1]:= ReleaseHold[Hold[2 4 6] //. Times->List]
Out[1]= {2, 4, 6}

Paul E Howland                         

Long Range Ground Radar Systems Section               tel. +44 (0)1684 895767
CSS2 Division, Room BY209                             fax. +44 (0)1684 896315
Defence Research Agency                           email: PEHOWLAND at DRA.HMG.GB 
Malvern, Worcs, WR14 3PS, UK.                      

  • Prev by Date: NeXT Mma 2.0 as Front-End to Mma 2.2?
  • Next by Date: changing the order of expand
  • Previous by thread: Re: Convert Products to Lists
  • Next by thread: Q: How to load packages inside a package