changeset 1276:623dfe0e2e73

change Luan.values
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 10 Dec 2018 15:04:09 -0700
parents cc3dabc05f72
children 5ba660381bd5
files conv.txt src/luan/modules/BasicLuan.java src/luan/modules/Io.luan website/src/manual.html.luan
diffstat 4 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/conv.txt	Tue Dec 04 21:42:11 2018 -0700
+++ b/conv.txt	Mon Dec 10 15:04:09 2018 -0700
@@ -1,3 +1,4 @@
+"Luan.values"
 remove "as_table"
 
 "Thread.schedule"
--- a/src/luan/modules/BasicLuan.java	Tue Dec 04 21:42:11 2018 -0700
+++ b/src/luan/modules/BasicLuan.java	Mon Dec 10 15:04:09 2018 -0700
@@ -155,7 +155,8 @@
 			@Override public Object call(LuanState luan,Object[] unused) {
 				if( i >= args.length )
 					return LuanFunction.NOTHING;
-				return args[i++];
+				Object val = args[i++];
+				return new Object[]{i,val};
 			}
 		};
 	}
--- a/src/luan/modules/Io.luan	Tue Dec 04 21:42:11 2018 -0700
+++ b/src/luan/modules/Io.luan	Mon Dec 10 15:04:09 2018 -0700
@@ -42,7 +42,7 @@
 
 function Io.print_to(out,...)
 	local list = {}
-	for v in values(...) do
+	for _, v in values(...) do
 		list[#list+1] = to_string(v)
 		list[#list+1] = '\t'
 	end
--- a/website/src/manual.html.luan	Tue Dec 04 21:42:11 2018 -0700
+++ b/website/src/manual.html.luan	Mon Dec 10 15:04:09 2018 -0700
@@ -2170,7 +2170,7 @@
 Returns a function so that the construction
 
 <pre>
-	for v in Luan.values(&middot;&middot;&middot;) do <em>body</em> end
+	for i, v in Luan.values(&middot;&middot;&middot;) do <em>body</em> end
 </pre>
 
 <p>