MathGroup Archive 2007

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

Search the Archive

Re: Compatibility woes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76219] Re: Compatibility woes
  • From: Albert <awnl at arcor.net>
  • Date: Fri, 18 May 2007 06:04:34 -0400 (EDT)
  • References: <f2hart$1ok$1@smc.vnet.net>

Bill Rowe wrote:
> On 5/16/07 at 5:27 AM, murray at math.umass.edu (Murray Eisenberg)
> wrote:
> 
>> In 6.0, you don't seem to need to load any package to use
>> ToPackedArray.
> 
> This definitely is not true for my installation of version 6.0
> 
> If I type ToPackedArray in a fresh session it is colored blue
> just like any other symbol I type that has not been defined. If
> I execute Get["Developer`"] in another cell, the color
> immediately turns from blue to black, indicating ToPackedArray
> now has a definition.

what people tried to tell you is that you don't need to load anything to 
use the function when using the full long name containing the Context. 
Type the following in a new session (Kernel must run for the syntax 
highlighting to work, I think) and you will see it turns black and thus 
is known to the Kernel without loading anything:

Developer`ToPackedArray

If you don't like to write out the Developer` every time, you need to 
change $ContextPath so that it contains a string "Developer`". One among 
other possibilities is to use Get["Developer`"]. For some reason 
Needs["Developer`"] does emit an error-message and probably sometimes 
does not work correctly (I guess when "Developer`" is in $Packages but 
not in $ContextPath it will fail), which I personally consider to be a 
bug. Still more efficient (no interaction with OS and file system) would 
be to evaluate:

If[!MemberQ[$ContextPath,"Developer`"],AppendTo[$ContextPath,"Developer`"]];

by the way, this is what a Developer.m in SystemFiles/Kernel/Packages 
does but I'm not sure whether it is the one that is called with 
Needs/Get and what the reason for the error message of 
Needs["Developer`"] is, because it actually _does_ create the Context 
"Developer`", but probably not in the way Needs expects that to happen 
(e.g. it does not create an entry in $Packages)... Maybe a 
BeginPackage/EndPackage would be more reliable there...

hth,

albert


  • Prev by Date: Re: Re: Compatibility woes
  • Next by Date: Re: Mathematica 6.0 and MatrixManipulations
  • Previous by thread: Re: Re: Compatibility woes
  • Next by thread: Re: Re: Compatibility woes