The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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 <> 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.


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

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

In[3]:= Attributes=MyAttributes;

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

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

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

In[7]:= ??a

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

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

In[9]:= ??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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.