Re: SetAttributes for entire package
- To: mathgroup at smc.vnet.net
- Subject: [mg111346] Re: SetAttributes for entire package
- From: Albert Retey <awnl at gmx-topmail.de>
- Date: Wed, 28 Jul 2010 02:55:02 -0400 (EDT)
- References: <i2mhck$3ct$1@smc.vnet.net>
Hi, > Is there a way to SetAttributes for all of the functions in a package? I > would like them all to be Locked and ReadProtected. you can get a list of all symbol names in your package with: Names["MyContext`*"] using SetAttributes on that list should work alright (I haven't tested the following but done things like this before): SetAttributes[ToExpression[Names["MyContext`*"]],{ReadProtected,Locked}] if you have symbols that have OwnValues defined in your package, you might need to delete those from the list of all symbols or need to be more careful when creating symbols from the symbol names. You also might want to protect the private functions of your package, if there are any... hth, albert