Mercurial Hosting > luan
comparison src/luan/lib/BasicLib.java @ 123:d7be9b3abf1a
minor - rename LuanFunction.EMPTY to NOTHING
git-svn-id: https://luan-java.googlecode.com/svn/trunk@124 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 06 Jun 2014 01:14:18 +0000 |
parents | 735708619119 |
children | f537ff5e511d |
comparison
equal
deleted
inserted
replaced
122:d00f41edbbd6 | 123:d7be9b3abf1a |
---|---|
118 | 118 |
119 private static LuanFunction pairs(final Iterator<Map.Entry<Object,Object>> iter) { | 119 private static LuanFunction pairs(final Iterator<Map.Entry<Object,Object>> iter) { |
120 return new LuanFunction() { | 120 return new LuanFunction() { |
121 @Override public Object[] call(LuanState luan,Object[] args) { | 121 @Override public Object[] call(LuanState luan,Object[] args) { |
122 if( !iter.hasNext() ) | 122 if( !iter.hasNext() ) |
123 return LuanFunction.EMPTY; | 123 return LuanFunction.NOTHING; |
124 Map.Entry<Object,Object> entry = iter.next(); | 124 Map.Entry<Object,Object> entry = iter.next(); |
125 return new Object[]{entry.getKey(),entry.getValue()}; | 125 return new Object[]{entry.getKey(),entry.getValue()}; |
126 } | 126 } |
127 }; | 127 }; |
128 } | 128 } |
227 return new LuanFunction() { | 227 return new LuanFunction() { |
228 double v = from; | 228 double v = from; |
229 | 229 |
230 @Override public Object call(LuanState luan,Object[] args) { | 230 @Override public Object call(LuanState luan,Object[] args) { |
231 if( step > 0.0 && v > to || step < 0.0 && v < to ) | 231 if( step > 0.0 && v > to || step < 0.0 && v < to ) |
232 return LuanFunction.EMPTY; | 232 return LuanFunction.NOTHING; |
233 double rtn = v; | 233 double rtn = v; |
234 v += step; | 234 v += step; |
235 return rtn; | 235 return rtn; |
236 } | 236 } |
237 }; | 237 }; |