Transient

Transient.field
specify not to export the marked field.
Transient.Class[type] := {defs}
suppresses the export of the whole class type.
  • The Transient property must be consistent accross inheritance.
  • If a class is marked Transient, all its members are implicitly transient.
This loads the package.
In[1]:=
Click for copyable input
First, we define a class with four fields, half of them transient and half of them bound to the class by means of Static.
In[2]:=
Click for copyable input
We can now export the object. The ClassMessage[] wrapper only affects the formatting of the file name.
In[3]:=
Click for copyable input
Out[3]=
We check that the object is not modified.
In[4]:=
Click for copyable input
Out[4]=
The object is now read in.
In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=
Finally, we remove the created directory.
In[7]:=
Click for copyable input
See Export for further examples.