Re: namespace collision [bug]
- To: mathgroup at smc.vnet.net
- Subject: [mg68715] Re: namespace collision [bug]
- From: albert <awnl at arcor.de>
- Date: Thu, 17 Aug 2006 04:18:22 -0400 (EDT)
- References: <ebujoc$6k9$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Chris, > As far as I know, a named pattern created inside the A`Private` > context should not interfere with the definition of a symbol with the > same name from B`. Will someone verify this as a bug? Will someone > please provide a workaround? No Bug, no workaround needed. Just make sure to sue Begin["`Private`"] instead of Begin["Private`"] (note the leading backquote). Only when using leading backquotes symbols are created in "A`Private`" resp. "B`Private`". Without it both symbols are created in "Private`" which in your case leads to the interference you are seeing... hth, albert > In[1]:= > BeginPackage["A`"]; > funA::usage=""; > Begin["Private`"]; > funA[funB_]:=funB!; > End[]; > EndPackage[]; > BeginPackage["B`"]; > Off[General::spell1]; > funB::usage=""; > funC::usage=""; > Begin["Private`"]; > funB[_]:="you called funB"; > funC[_]:="you called funC"; > End[]; > EndPackage[]; > > In[16]:= > funB[5] > > Out[16]= > funB[5] > > In[17]:= > funC[5] > > Out[17]= > you called funC > > In[18]:= > $Version > > Out[18]= > 5.2 for Microsoft Windows (June 20, 2005) >