MathGroup Archive 2006

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

Search the Archive

Re: Context


so, what are you actually trying to do that caused you to ask the
original question?

On 11/2/06, Daniel Huber <dh at metrohm.ch> wrote:
> Hi Chris,
> that's correct. The problem comes when you use SetDelayed.
> Daniel
>
> Chris Chiasson wrote:
> > I should have said it with code.
> >
> > If a text file contains the following 3 lines, I believe it should
> > print "x`".
> >
> > Begin["x`"];
> > Print[Context[t]];
> > End[];
> >
> >
> >
> > On 11/2/06, Daniel Huber <dh at metrohm.ch> wrote:
> >> Hi Chris,
> >> it does not matter how you load fun. You get the same behaviour if you
> >> use Get.
> >> Daniel
> >>
> >>
> >> Daniel
> >>
> >>
> >> Chris Chiasson wrote:
> >> > I am guessing that Get only has different behavior because it passes
> >> > the commands into the Kernel sequentially. fun is only sending a
> >> > single CompoundExpression (and it has already been parsed by the time
> >> > it has been defined).
> >> >
> >> > On 11/2/06, dh <dh at metrohm.ch> wrote:
> >> >>
> >> >> Hello,
> >> >>
> >> >> consider:
> >> >>
> >> >> fun[x_]:=( Begin[x];
> >> >>
> >> >>        Print[t];
> >> >>
> >> >>        End[];
> >> >>
> >> >>        );
> >> >>
> >> >> according to the manual one would think that the variable t in
> >> context x
> >> >>
> >> >> is printed. However, this is wrong! What is printed is Global`t.
> >> >>
> >> >> Therefore, the context to which a symbol belongs is determined during
> >> >>
> >> >> parsing and NOT execution.
> >> >>
> >> >> Can anybode give more insight and strict rules for this quirck?
> >> >>
> >> >> Daniel
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >> --
> >>
> >> Daniel Huber
> >> Metrohm Ltd.
> >> Oberdorfstr. 68
> >> CH-9100 Herisau
> >> Tel. +41 71 353 8585, Fax +41 71 353 8907
> >> E-Mail:<mailto:dh at metrohm.ch>
> >> Internet:<http://www.metrohm.ch>
> >>
> >>
> >
> >
>
>
> --
>
> Daniel Huber
> Metrohm Ltd.
> Oberdorfstr. 68
> CH-9100 Herisau
> Tel. +41 71 353 8585, Fax +41 71 353 8907
> E-Mail:<mailto:dh at metrohm.ch>
> Internet:<http://www.metrohm.ch>
>
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Context
  • Next by Date: Re: Clarification re. Curiosity concerning transformation rules for List
  • Previous by thread: Re: Context
  • Next by thread: Re: Context