comparison website/src/manual.html.luan @ 567:6c00b8a59240

document Binary
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 05 Jul 2015 19:29:56 -0600
parents 90b93790c544
children 1e69d9c21461
comparison
equal deleted inserted replaced
566:90b93790c544 567:6c00b8a59240
89 <ul> 89 <ul>
90 <li><a href="#default_lib">Default Environment</a></li> 90 <li><a href="#default_lib">Default Environment</a></li>
91 <li><a href="#luan_lib">Basic Functions</a></li> 91 <li><a href="#luan_lib">Basic Functions</a></li>
92 <li><a href="#package_lib">Modules</a></li> 92 <li><a href="#package_lib">Modules</a></li>
93 <li><a href="#string_lib">String Manipulation</a></li> 93 <li><a href="#string_lib">String Manipulation</a></li>
94 <li><a href="#binary_lib">Binary Manipulation</a></li>
94 <li><a href="#table_lib">Table Manipulation</a></li> 95 <li><a href="#table_lib">Table Manipulation</a></li>
95 <li><a href="#number_lib">Number Manipulation</a></li> 96 <li><a href="#number_lib">Number Manipulation</a></li>
96 <li><a href="#math_lib">Mathematical Functions</a></li> 97 <li><a href="#math_lib">Mathematical Functions</a></li>
97 </ul> 98 </ul>
98 </div> 99 </div>
2655 2656
2656 2657
2657 2658
2658 2659
2659 2660
2661 <h3 heading><a name="binary_lib">Binary Manipulation</a></h3>
2662
2663 <p>
2664 Include this library by:
2665
2666 <pre>
2667 local Binary = require "luan:Binary"
2668 </pre>
2669
2670
2671 <h4 heading><a name="Binary.binary"><code>Binary.binary (&middot;&middot;&middot;)</code></a></h4>
2672
2673 <p>
2674 Receives zero or more bytes (as integers).
2675 Returns a binary with length equal to the number of arguments,
2676 in which each byte has the internal numerical code equal
2677 to its corresponding argument.
2678
2679
2680 <h4 heading><a name="Binary.byte"><code>Binary.byte (b [, i [, j]])</code></a></h4>
2681
2682 <p>
2683 Returns the internal numerical codes of the bytes <code>b[i]</code>,
2684 <code>b[i+1]</code>, ..., <code>b[j]</code>.
2685 The default value for <code>i</code> is&nbsp;1;
2686 the default value for <code>j</code> is&nbsp;<code>i</code>.
2687 These indices are corrected
2688 following the same rules of function <a href="#String.sub"><code>String.sub</code></a>.
2689
2690
2691 <h4 heading><a name="Binary.to_string"><code>Binary.to_string (b)</code></a></h4>
2692 <p>
2693 Converts the binary <code>b</code> to a string using the Java <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#String(byte[])">String constructor</a>.
2694
2660 2695
2661 2696
2662 2697
2663 <h3 heading><a name="table_lib">Table Manipulation</a></h3> 2698 <h3 heading><a name="table_lib">Table Manipulation</a></h3>
2664 2699