diff src/luan/lib/IoLib.java @ 118:735708619119

add Debug.debug() git-svn-id: https://luan-java.googlecode.com/svn/trunk@119 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Sun, 01 Jun 2014 07:07:31 +0000
parents 1ff1c32417eb
children d00f41edbbd6
line wrap: on
line diff
--- a/src/luan/lib/IoLib.java	Fri May 30 08:57:24 2014 +0000
+++ b/src/luan/lib/IoLib.java	Sun Jun 01 07:07:31 2014 +0000
@@ -34,6 +34,7 @@
 				add( module, "java_resource_to_url", String.class );
 				add( module, "url", String.class );
 				add( module, "java_resource", String.class );
+				add( module, "read_console_line", String.class );
 
 				LuanTable stdin = new LuanTable();
 				stdin.put( "read_text", new LuanJavaFunction(
@@ -222,6 +223,12 @@
 		return url(java_resource_to_url(path));
 	}
 
+	public static String read_console_line(String prompt) throws IOException {
+		if( prompt==null )
+			prompt = "> ";
+		return System.console().readLine(prompt);
+	}
+
 
 	public interface LuanWriter {
 		public void write(LuanState luan,Object... args) throws LuanException, IOException;