Re: original meaning of System` functions
- To: mathgroup at smc.vnet.net
- Subject: [mg115446] Re: original meaning of System` functions
- From: Yuri Kandrashkin <spinalgebra at gmail.com>
- Date: Tue, 11 Jan 2011 06:58:02 -0500 (EST)
My 2 cents:
1. The functions which code is planning to hide should not have attribute
Protected and Locked because this prevents some operations like SetOptions
etc. It is better to refer to a separate function, which must have
attributes Locked, Protected, and ReadProtected.
For example:
Func[args__,opts:OptionPattern[]] :== func[args,opts];
definition of func
SetAttributes[func,{Locked, Protected, ReadProtected}];
2. In general it is convenient to separate the code packages and loading
package. In this case the code packages should be encrypted with a key. The
loading package should be also encrypted with or without key depending on
the application distribution conditions.
3. The loading package should solve the following tasks:
- Checking if the crucial System functions have been changed. This task
is most complicate and currently I don't know any bulletproof solution
unless WRI will provide a block-like function in which it would be allowed
to use only unmodified functions of the Mathematica kernel.
- Checking of the existence of the functions of your applications. It is
quite simple to get a code of the function if one sets the attribute Locked
BEFORE the loading its definitions. At this stage the full names should be
used to prevent shadowing.
- Loading the code packages applying the key if the previous tests
haven't failed.
Yuri
2011/1/11 hemmecke <hemmecke at gmail.com>
On Jan 10, 8:38 am, DrMajorBob <btre... at austin.rr.com> wrote:
> > I suppose you could export brief "shell" functions that call the ones
> you==
>
> > want to hide (which you would not export).
>
> Since Mathematica has no concept of a proper namespace, there is
> actually no difference between "exported" and "non-exported". You can
> easily get all the names of the package P by asking for
>
> Names["P`*"]
> Names["P`Private`*"]
>
> Then
>
> ??P`Private`F
>
> for some function F listed above, will show you the source.
>
> Can you please detail a bit more of what you mean?
>
> Ralf
>
>