MathGroup Archive 2002

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

Search the Archive

Re: memoizing function again

In article <a2ong2$5uo$1 at>, kuska at 

> ClearConstantArg[f_Symbol] := 
>   DownValues[f] = 
>     DownValues[f] /. (Verbatim[HoldPattern][f[_Integer]] :> _) :>
> Sequence[]
> will do it. For what do wish to use Cases[] ?

Because Cases (or DeleteCases) is (slightly) more elegant?

   ClearConstantArg[f_Symbol] := 
      DownValues[f] = DeleteCases[DownValues[f], 
         Verbatim[HoldPattern][f[_Integer]] :> _]


Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at 

            God IS a weakly left-handed dice player

  • Prev by Date: Re: Re: Simulating Correlated non-Normal Random Variables
  • Next by Date: Re: Keeping order with Union
  • Previous by thread: RE: RE: memoizing function again
  • Next by thread: Mathematica for Linux font problem on SuSE7.3