changeset 1090:616761e0b9f6

update documentation for last change
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 30 Dec 2016 13:13:16 -0700
parents 894786a03d22
children 20d5968e65cc
files website/src/diff.html.luan website/src/manual.html.luan
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
diff -r 894786a03d22 -r 616761e0b9f6 website/src/diff.html.luan
--- a/website/src/diff.html.luan	Thu Dec 29 21:26:45 2016 -0700
+++ b/website/src/diff.html.luan	Fri Dec 30 13:13:16 2016 -0700
@@ -204,6 +204,8 @@
 
 <h4 heading><a name="fn_calls">Function Calls</a></h4>
 
+<p>Unlike Lua, Luan does not allow extra non-nil arguments to be passed to a function.  In Luan, this causes an error.  This change helps find coding mistakes that would be very hard to detect otherwise.</p>
+
 <p>Luan does not support Lua's <code>v:name(args)</code> style object-oriented function call.  Object oriented programming is done in Luan using closures, so this feature is not needed.</p>
 
 <p>Luan doesn't support <em>proper tail calls</em>.  Because Java doesn't support this cleanly, this was left out.</p>
diff -r 894786a03d22 -r 616761e0b9f6 website/src/manual.html.luan
--- a/website/src/manual.html.luan	Thu Dec 29 21:26:45 2016 -0700
+++ b/website/src/manual.html.luan	Fri Dec 30 13:13:16 2016 -0700
@@ -1607,7 +1607,7 @@
 <p>
 When a function is called,
 the list of arguments is adjusted to
-the length of the list of parameters,
+the length of the list of parameters if the list is too short,
 unless the function is a <em>vararg function</em>,
 which is indicated by three dots ('<code>...</code>')
 at the end of its parameter list.
@@ -1643,9 +1643,9 @@
      
      f(3)             a=3, b=nil
      f(3, 4)          a=3, b=4
-     f(3, 4, 5)       a=3, b=4
-     f(r(), 10)       a=1, b=10
-     f(r())           a=1, b=2
+     f(3, 4, 5)       runtime error
+     f(r(), 10)       runtime error
+     f(r())           runtime error
      
      g(3)             a=3, b=nil, ... --&gt;  (nothing)
      g(3, 4)          a=3, b=4,   ... --&gt;  (nothing)