Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > e3918135d52936bad0ecc8654eedea12 > files > 149

Falcon-doc-0.9.6.8-1.fc15.noarch.rpm

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head><meta content="text/html;charset=&amp;quot;utf-8&amp;quot;" http-equiv="Content-type"/><link href="faldoc.css" rel="stylesheet" type="text/css"/><title> - Functions</title></head><body class="faldoc"><ul class="navi_top"><li class="top"><a href="index.html">Top: Table of contents</a></li>
         <li class="up"><a href="feathers_funcext.html">Up: Functional extensions</a></li>
         <li class="prev"><a href="feathers_funcext.html">Previous: Functional extensions</a></li>
         <li class="next"><a href="feathers_hash.html">Hashing algorighms</a></li>
         <li class="clear"></li>
         </ul><div id="page_body"><h1><span class="toc_number">2.4.1</span>Functions</h1><h3><a name="add">add</a></h3><p class="brief">Adds two items along the rules of VM '+' operator. </p>
         <pre class="prototype">add( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">The result of the sum. </td></tr>
               </tbody>
            </table>
         <p>This function operates also on strings, arrays and dictionaries replicating the behavior of the "+" operator as it is performed by the VM. </p>
<h3><a name="at">at</a></h3><p class="brief">Passe-par-tout accessor function. </p>
         <pre class="prototype">at( item, access, [value] )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">item</td><td class="content"> An array, string, or any accessible item or collection. </td></tr>
               <tr class="param"><td class="name">access</td><td class="content"> A number, a range or a string to access the item. </td></tr>
               <tr class="optparam"><td class="name">value</td><td class="content"> If given, will substitue the given item or range (new value). </td></tr>
               <tr class="raise"><td class="name">Raise</td><td class="content"><table>
                     <tbody><tr><td class="name"><b>AccessError</b></td><td class="content"> in case the accessor is invalid for the given item type. </td></tr>
                           </tbody>
                        </table>
                     </td></tr>
               </tbody>
            </table>
         <p>This function emulates all the language-level accessors provided by Falcon. Subscript accessors ([]) accepting numbers, ranges and generic items (for dictionaries) and property accessors (.) accepting strings are fully supported. When two parameters are passed, the function works in access semantics, while when the <b>value</b> parameter is also given, the function will work as an accessor/subscript assignment. In example, to change a string the <b>at</b> function can be used as a range accessor: </p>
<pre>

      string = "hello"
      string[0:1] = "H"          //first letter up
      at( string, [1:], "ELLO" ) // ...all up
      &gt; string
      &gt; "First letter: ", at( string, 0 )
                          // ^^^ same as string[0]
</pre><p>This function is also able to access and modify the bindings of arrays (i.e. like accessing the arrays using the "." operator), members of objects and instances and static methods of classes. Properties and bindings can be accessed by names as strings. In example: </p>
<pre>

      // making a binding
      // ... equivalent to "array.bind = ..."
      array = []
      at( array, "bind", "binding value" )
      &gt; array.bind

      //... accessing a property
      at( CurrentTime(), "toRFC2822" )()
</pre><p>Trying to access an item with an incompatible type of accessor (i.e. trying to access an object with a range, or a string with a string). </p>
<p class='note'><b>Note:</b> At the moment, the <b>at</b> function doesn't support BOM methods. </p>
<h3><a name="deq">deq</a></h3><p class="brief">Performs a deep equality check. </p>
         <pre class="prototype">deq( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">true if the two items are deeply equal (same content). </td></tr>
               </tbody>
            </table>
         <h3><a name="div">div</a></h3><p class="brief">Divides two numeric operands along the rules of VM '/' operator. </p>
         <pre class="prototype">div( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">The result of the division. </td></tr>
               </tbody>
            </table>
         <h3><a name="equal">equal</a></h3><p class="brief">Performs a lexicographic check for the first operand being equal to the second. </p>
         <pre class="prototype">equal( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">true if a == b, false otherwise. </td></tr>
               </tbody>
            </table>
         <h3><a name="ge">ge</a></h3><p class="brief">Performs a lexicographic check for the first operand being greater or equal to the second. </p>
         <pre class="prototype">ge( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">true if a >= b, false otherwise. </td></tr>
               </tbody>
            </table>
         <h3><a name="gt">gt</a></h3><p class="brief">Performs a lexicographic check for the first operand being greater than the second. </p>
         <pre class="prototype">gt( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">true if a > b, false otherwise. </td></tr>
               </tbody>
            </table>
         <h3><a name="le">le</a></h3><p class="brief">Performs a lexicographic check for the first operand being less or equal to the second. </p>
         <pre class="prototype">le( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">true if a <= b, false otherwise. </td></tr>
               </tbody>
            </table>
         <h3><a name="lt">lt</a></h3><p class="brief">Performs a lexicographic check for the first operand being less than the second. </p>
         <pre class="prototype">lt( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">true if a < b, false otherwise. </td></tr>
               </tbody>
            </table>
         <h3><a name="mod">mod</a></h3><p class="brief">Performs a modulo division on numeric operands along the rules of VM '%' operator. </p>
         <pre class="prototype">mod( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">The result of the modulo. </td></tr>
               </tbody>
            </table>
         <h3><a name="mul">mul</a></h3><p class="brief">Multiplies two items along the rules of VM '*' operator. </p>
         <pre class="prototype">mul( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">The result of the multiplication. </td></tr>
               </tbody>
            </table>
         <p>This function operates also on strings, arrays and dictionaries replicating the behavior of the "*" operator as it is performed by the VM. </p>
<h3><a name="neq">neq</a></h3><p class="brief">Performs a lexicographic check for the first operand being not equal to the second. </p>
         <pre class="prototype">neq( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">true if a == b, false otherwise. </td></tr>
               </tbody>
            </table>
         <h3><a name="sub">sub</a></h3><p class="brief">Subtracts two items along the rules of VM '-' operator. </p>
         <pre class="prototype">sub( a, b )</pre>
         <table class="prototype">
         <tbody><tr class="param"><td class="name">a</td><td class="content"> First operand </td></tr>
               <tr class="param"><td class="name">b</td><td class="content"> Second operand </td></tr>
               <tr class="return"><td class="name">Return</td><td class="content">The result of the subtraction. </td></tr>
               </tbody>
            </table>
         <p>This function operates also on strings, arrays and dictionaries replicating the behavior of the "-" operator as it is performed by the VM. </p>
</div><ul class="navi_bottom"><li class="top"><a href="index.html">Top: Table of contents</a></li>
         <li class="up"><a href="feathers_funcext.html">Up: Functional extensions</a></li>
         <li class="prev"><a href="feathers_funcext.html">Previous: Functional extensions</a></li>
         <li class="next"><a href="feathers_hash.html">Hashing algorighms</a></li>
         <li class="clear"></li>
         </ul><div class="signature">Made with <a href="faldoc 3.0">http://www.falconpl.org</a></div></body></html>