MathGroup Archive 2010

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

Search the Archive

Re: Retrieving orphaned code

  • To: mathgroup at
  • Subject: [mg109078] Re: Retrieving orphaned code
  • From: Bob Hanlon <hanlonr at>
  • Date: Mon, 12 Apr 2010 06:56:21 -0400 (EDT)

f[a_, b_, c_, x_] := Module[{d, e, f},
  d = a + b/2;
  e = Exp[-c*x];
  d*x^2 + e*x + c]

DownValues[f] // InputForm

{HoldPattern[f[a_, b_, c_, x_]] :> Module[{d, e, f}, 
   d = a + b/2; e = Exp[(-c)*x]; d*x^2 + e*x + c]}

However, other Values could have been defined so

n = ToExpression[Names["*Values"]]


Select[{#, #[f]} & /@ n, FreeQ[#[[2]], #[[1]]] &] // Quiet

Bob Hanlon

---- Michael Young <michaelcharlesyoung at> wrote: 


I seem to have accidentally 'orphaned' three functions i built .

That is, the code is still active in memory, and the function name  
shows in black and displays its intended data ; however, the file's  
copies of the functions' source-code have been modified and recompiled  
under different names, for different purposes .

Is there a way to retrieve function source-code in Mathematica ?


  • Prev by Date: Re: How do you get Mathematica to evaluate "Floor" to give a number?
  • Next by Date: Re: List Manipulation: Conditionally changing y value when x value
  • Previous by thread: Re: Retrieving orphaned code
  • Next by thread: Re: Using numbers close to to zero in Mathematica version 6