RE: Context
- To: mathgroup at smc.vnet.net
- Subject: [mg70985] RE: [mg70956] Context
- From: "Virgilio, Vincent - SSD" <Vincent.Virgilio at itt.com>
- Date: Fri, 3 Nov 2006 01:39:40 -0500 (EST)
Likely the current context doesn't change until the end of the current expression (similar to the play between side-effects and sequence points in C/C++). Below, a CompoundExpression[] contains a Begin[]. I think the Begin[] will not affect anything in that CompoundExpression[]. So Mathematica creates t in Global` rather than x`, which you see. I don't know how to draw a line between parsing and execution in Mathematica. Perhaps it could be done in terms of the documented evaluation process. There's been some talk on this lately, I think about Format[]. Anyone care to elaborate? Vince Virgilio -----Original Message----- From: dh [mailto:dh at metrohm.ch] To: mathgroup at smc.vnet.net Subject: [mg70985] [mg70956] Context 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 ************************************ This e-mail and any files transmitted with it are proprietary and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT, Inc. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail. ************************************
- Follow-Ups:
- Re: RE: Context
- From: Sseziwa Mukasa <mukasa@jeol.com>
- Re: RE: Context