comparison website/src/manual.html.luan @ 1090:616761e0b9f6

update documentation for last change
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 30 Dec 2016 13:13:16 -0700
parents 9c13a15a4002
children a26fbde7ee28
comparison
equal deleted inserted replaced
1089:894786a03d22 1090:616761e0b9f6
1605 </pre> 1605 </pre>
1606 1606
1607 <p> 1607 <p>
1608 When a function is called, 1608 When a function is called,
1609 the list of arguments is adjusted to 1609 the list of arguments is adjusted to
1610 the length of the list of parameters, 1610 the length of the list of parameters if the list is too short,
1611 unless the function is a <em>vararg function</em>, 1611 unless the function is a <em>vararg function</em>,
1612 which is indicated by three dots ('<code>...</code>') 1612 which is indicated by three dots ('<code>...</code>')
1613 at the end of its parameter list. 1613 at the end of its parameter list.
1614 A vararg function does not adjust its argument list; 1614 A vararg function does not adjust its argument list;
1615 instead, it collects all extra arguments and supplies them 1615 instead, it collects all extra arguments and supplies them
1641 <pre> 1641 <pre>
1642 CALL PARAMETERS 1642 CALL PARAMETERS
1643 1643
1644 f(3) a=3, b=nil 1644 f(3) a=3, b=nil
1645 f(3, 4) a=3, b=4 1645 f(3, 4) a=3, b=4
1646 f(3, 4, 5) a=3, b=4 1646 f(3, 4, 5) runtime error
1647 f(r(), 10) a=1, b=10 1647 f(r(), 10) runtime error
1648 f(r()) a=1, b=2 1648 f(r()) runtime error
1649 1649
1650 g(3) a=3, b=nil, ... --&gt; (nothing) 1650 g(3) a=3, b=nil, ... --&gt; (nothing)
1651 g(3, 4) a=3, b=4, ... --&gt; (nothing) 1651 g(3, 4) a=3, b=4, ... --&gt; (nothing)
1652 g(3, 4, 5, 8) a=3, b=4, ... --&gt; 5 8 1652 g(3, 4, 5, 8) a=3, b=4, ... --&gt; 5 8
1653 g(5, r()) a=5, b=1, ... --&gt; 2 3 1653 g(5, r()) a=5, b=1, ... --&gt; 2 3