Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: original meaning of System` functions
Replies: 11   Last Post: Jan 11, 2011 7:24 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
hemmecke

Posts: 15
Registered: 3/11/10
Re: original meaning of System` functions
Posted: Jan 11, 2011 7:24 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Jan 10, 8:35 am, Bill Rowe <readn...@sbcglobal.net> wrote:
> It is possible to distribute Mathematica code so that the source
> code cannot be accessed in any meaningful way and be usable
> within Mathematica. Take a look at ReadProtected and Encode.


Not so trivial, actually. Suppose, I load your package after In[4].

It is clear that Encode must be used, but it doesn't help at all.
The person who should be able to run the code, needs the key when
he reads in the package.

Ralf

In[1]:= Unprotect[SetAttributes,Attributes];

In[2]:= SetAttributes[Except[{SetAttributes,Set,Attributes}],_]:={}

In[3]:= Attributes=MyAttributes;

In[4]:= SetAttributes[{SetAttributes,Set,Attributes},
{Protected,Locked}];

In[5]:= a[x_] := Module[{z}, z=x+3, z^2];

In[6]:= SetAttributes[a,{ReadProtected,Locked}];

In[7]:= ??a
Global`a

a[x_] := Module[{z}, z = x + 3, z^2]

In[8]:= Attributes[a]={ReadProtected,Locked};

In[9]:= ??a
Global`a

a[x_] := Module[{z}, z = x + 3, z^2]

In[10]:= ClearAll[SetAttributes]

ClearAll::wrsym: Symbol SetAttributes is Protected.

In[11]:= Unprotect[SetAttributes]

Protect::locked: Symbol SetAttributes is locked.

Out[11]= {}

In[12]:= ClearAll[Attributes]

ClearAll::wrsym: Symbol Attributes is Protected.

In[13]:= Attributes

Out[13]= MyAttributes




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.