Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Flat

Usage
Notes
Further Examples

This clears all of the rules and attributes for a symbol fff.

In[1]:=  

This gives fff the attribute Flat.

In[2]:=  

Inputs with a head of fff will now be flattened automatically over fff.

In[3]:=  

Out[3]=

The Flat attribute also has an effect in pattern matching. This rule applies because of the Flat attribute.

In[4]:=  

Out[4]=

This removes the Flat attribute from fff.

In[5]:=  

Without the Flat attribute, this rule is not used.

In[6]:=  

Out[6]=

Associative operations, such as Plus, have the Flat attribute.

In[7]:=  

Out[7]=

This rule is applied because of the Flat attribute of Plus.

In[8]:=  

Out[8]=

This also works.

In[9]:=  

Out[9]=

RunLengthEncode gives a list of pairs. The pair {x, y} corresponds to a run of length y of the element x. (See the Further Examples for Split for another implementation.)

In[10]:=  

In[11]:=  

In[12]:=  

In[13]:=  

Out[13]=


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: