MathGroup Archive 2007

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

Search the Archive

Re: Variable containing code

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74960] Re: Variable containing code
  • From: "dimitris" <dimmechan at yahoo.com>
  • Date: Fri, 13 Apr 2007 01:56:36 -0400 (EDT)
  • References: <evkrsc$o5q$1@smc.vnet.net>

In[36]:=
Clear[t1,t2]
t1=f["Hello"]
t2=t1
t2/.f->Print

Out[37]=
f[Hello]

Out[38]=
f[Hello]

>From In[36]:=
Hello

In[40]:=
Clear[t1,t2]
t1=HoldForm[Print["Hello"]]
t2=t1
t2//ReleaseHold

Out[41]=
Print[Hello]

Out[42]=
Print[Hello]

>From In[40]:=
Hello

???

Dimitris


=CF/=C7 dh =DD=E3=F1=E1=F8=E5:
> Hello,
>
> 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 co=
de?
>
> Daniel



  • Prev by Date: Re: Variable containing code
  • Next by Date: Re: About Table
  • Previous by thread: Re: Variable containing code
  • Next by thread: Re: Variable containing code