comparison core/src/luan/modules/BasicLuan.java @ 626:53a50c70c5e2

add Luan.assert_function() and Http.run_later()
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 17 Jan 2016 06:19:46 -0700
parents 97c8ae330efe
children 859c0dedc8b6
comparison
equal deleted inserted replaced
625:a3c1e11fb6aa 626:53a50c70c5e2
155 @LuanMethod public static byte[] assert_binary(LuanState luan,byte[] v) throws LuanException { 155 @LuanMethod public static byte[] assert_binary(LuanState luan,byte[] v) throws LuanException {
156 Utils.checkNotNull(luan,v); 156 Utils.checkNotNull(luan,v);
157 return v; 157 return v;
158 } 158 }
159 159
160 public static LuanFunction assert_function(LuanState luan,LuanFunction v) throws LuanException {
161 Utils.checkNotNull(luan,v);
162 return v;
163 }
164
160 public static LuanFunction range(LuanState luan,final double from,final double to,Double stepV) throws LuanException { 165 public static LuanFunction range(LuanState luan,final double from,final double to,Double stepV) throws LuanException {
161 final double step = stepV==null ? 1.0 : stepV; 166 final double step = stepV==null ? 1.0 : stepV;
162 if( step == 0.0 ) 167 if( step == 0.0 )
163 throw new LuanException(luan,"bad argument #3 (step may not be zero)"); 168 throw new LuanException(luan,"bad argument #3 (step may not be zero)");
164 return new LuanFunction() { 169 return new LuanFunction() {