comparison website/src/manual.html.luan @ 695:5042e487d717

documentation
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 20 Apr 2016 21:09:48 -0600
parents ca169567ce07
children 87970832a3c3
comparison
equal deleted inserted replaced
694:b620b8e1010f 695:5042e487d717
1890 end 1890 end
1891 </pre> 1891 </pre>
1892 1892
1893 1893
1894 1894
1895 <h4 heading><a name="Luan.eval" href="#Luan.eval"><code>Luan.eval (text [, source_name])</code></a></h4>
1896
1897 <p>
1898 Evaluates <code>text</code> as a Luan expression.
1899
1900 <p>
1901 Could be defined as:
1902
1903 <pre>
1904 function Luan.eval(text,source_name)
1905 return Luan.load( "return "..text, source_name or "eval" )()
1906 end
1907 </pre>
1908
1909
1910
1895 <h4 heading><a name="Luan.get_metatable" href="#Luan.get_metatable"><code>Luan.get_metatable (table)</code></a></h4> 1911 <h4 heading><a name="Luan.get_metatable" href="#Luan.get_metatable"><code>Luan.get_metatable (table)</code></a></h4>
1896 1912
1897 <p> 1913 <p>
1898 If <code>table</code> does not have a metatable, returns <b>nil</b>. 1914 If <code>table</code> does not have a metatable, returns <b>nil</b>.
1899 Otherwise, 1915 Otherwise,
1932 end 1948 end
1933 </pre> 1949 </pre>
1934 1950
1935 1951
1936 1952
1937 <h4 heading><a name="Luan.load" href="#Luan.load"><code>Luan.load (text, [source_name [env, [, allow_expression]]])</code></a></h4> 1953 <h4 heading><a name="Luan.load" href="#Luan.load"><code>Luan.load (text, source_name [, env])</code></a></h4>
1938 1954
1939 <p> 1955 <p>
1940 Loads a chunk. 1956 Loads a chunk.
1941 1957
1942 <p> 1958 <p>
1948 <p> 1964 <p>
1949 The <code>source_name</code> parameter is a string saying where the text came from. It is used to produce error messages. 1965 The <code>source_name</code> parameter is a string saying where the text came from. It is used to produce error messages.
1950 1966
1951 <p> 1967 <p>
1952 If the <code>env</code> parameter is supplied, it becomes the <code>_ENV</code> of the chunk. 1968 If the <code>env</code> parameter is supplied, it becomes the <code>_ENV</code> of the chunk.
1953
1954 <p>
1955 If the <code>allow_expression</code> parameter is <code>true</code> then the entire text can be nothing more than an expression in which case the chunk returns the value of this expression.
1956 1969
1957 1970
1958 <h4 heading><a name="Luan.load_file" href="#Luan.load_file"><code>Luan.load_file ([file_uri])</code></a></h4> 1971 <h4 heading><a name="Luan.load_file" href="#Luan.load_file"><code>Luan.load_file ([file_uri])</code></a></h4>
1959 1972
1960 <p> 1973 <p>