If and symbol creation
- To: mathgroup at smc.vnet.net
- Subject: [mg90376] If and symbol creation
- From: Mark Fisher <particlefilter at gmail.com>
- Date: Tue, 8 Jul 2008 02:23:13 -0400 (EDT)
I'd like to use an If statement to conditionally load a package and make some assignments, but I'm running into a problem with CompoundExpression. Here's an example: (Needs["Calendar`"]; fun = DayOfWeek) This creates DayOfWeek in the Global context before the effect of the Needs statement takes effect. The same thing happens in an If statement. BTW, DayOfWeek gets put in the Global context even in the following: If[True, 1, Needs["Calendar`"]; fun = DayOfWeek] Anyway, do people do to avoid this problem? --Mark