Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Context

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70960] Re: [mg70956] Context
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Fri, 3 Nov 2006 01:39:03 -0500 (EST)
  • References: <200611021149.GAA15806@smc.vnet.net>

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
>
>
>


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


  • References:
  • Prev by Date: Re: Context
  • Next by Date: Re: Factor.....
  • Previous by thread: Re: Context
  • Next by thread: Re: Context