MathGroup Archive 2006

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

Search the Archive

Re: How to hide mathematica code?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64475] Re: [mg64431] How to hide mathematica code?
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Sat, 18 Feb 2006 02:50:03 -0500 (EST)
  • References: <200602170911.EAA00691@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 17 Feb 2006, at 10:11, Alexander wrote:

> Dear Mathgroup!
>
> Is there any possibility to define a function and hide it's  
> implementation?
> The answer seems to be "no".
>
> Alexander.
>

I think the answer is yes (with one reservation). Here is an example:

In[1]:=
f[x_]:=x^2;

In[2]:=
SetAttributes[f,{Locked,Protected,ReadProtected}]

In[3]:=
DumpSave["f.mx",f];

Now quite the kernel and read in the file "f.mx".

In[1]:=
<< "f.mx"

In[2]:=
f[2]

Out[2]=
4

In[3]:=
?f

Global`f

Attributes[f] = {Locked, Protected, ReadProtected}

Opening the file f.mx also does not reveal any information about f.  
The only problem is that the file f.mx is not portable to a different  
platform.


  • Prev by Date: Re: Not Using a Text Editor Interface for Mathematica
  • Next by Date: Re: How to hide mathematica code?
  • Previous by thread: How to hide mathematica code?
  • Next by thread: Re: How to hide mathematica code?