Re: Variable containing code
- To: mathgroup at smc.vnet.net
- Subject: [mg75119] Re: Variable containing code
- From: Daniel Huber <d_huber at freesurf.ch>
- Date: Wed, 18 Apr 2007 04:53:40 -0400 (EDT)
- References: <evkrsc$o5q$1@smc.vnet.net> <evn6a6$34$1@smc.vnet.net>
Hi Albert, thank's for this simple solution. Daniel Albert wrote: > Hi, > >> how can one get at the value of a variable if this value is executable >> >> code? E.g. consider variable t1:= Print["Hello"]. How can I set the >> >> value of a second variable t2 to the value of t1 without executing the code? > > either look up my other post about manipulating $Epilog or look up > OwnValues in the HelpBrowser. Or just use this: > > OwnValues[t2] = OwnValues[t1] /. HoldPattern[t1] :> t2 > > > hth, > > albert >