MathGroup Archive 2010

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

Search the Archive

Re: SetAttributes for entire package

  • To: mathgroup at
  • Subject: [mg111371] Re: SetAttributes for entire package
  • From: Bill Rowe <readnews at>
  • Date: Thu, 29 Jul 2010 06:43:41 -0400 (EDT)

On 7/28/10 at 2:54 AM, dbreiss at (David Reiss) wrote:

>This would be quite simple if SetAttrubutes accepted string
>arguments.  If it did then you could simply execute

>SetAttributes[#,{Locked, ReadProtected}]&[Names["mycontext`*]]

>where mycontext is your package context.  Howe er SetAttributes does
>not work this way (but it should...).

>So one has to work around this.  I had to do this years ago when
>creating a password protection scheme for

You didn't say what your work around was. I note the following

In[1]:= BeginPackage["test`"];
f[x_] := 2 x
g[x_] := 1/x

In[5]:= SetAttributes[#, {Locked, ReadProtected}] & /@ Names["test`*"];

In[6]:= Attributes[g]

Out[6]= {Locked,ReadProtected}

In[7]:= Attributes[f]

Out[7]= {Locked,ReadProtected}

Given this does what you seem to want and requires about the
same number of keystrokes to enter, if you consider this a "work
around" I contend it doesn't involve any significant effort. And
given this does the job, it isn't clear to me any thing needs to
be changed.

  • Prev by Date: Re: How to remove cells with a style?
  • Next by Date: Re: NDSolve for catenary
  • Previous by thread: Re: SetAttributes for entire package
  • Next by thread: Re: SetAttributes for entire package