Mercurial Hosting > luan
comparison src/luan/Luan.java @ 105:a9560839104d
minor - change type names to lower case like Lua
git-svn-id: https://luan-java.googlecode.com/svn/trunk@106 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Tue, 13 May 2014 06:03:09 +0000 |
parents | 754e6030c029 |
children | 2428ecfed375 |
comparison
equal
deleted
inserted
replaced
104:754e6030c029 | 105:a9560839104d |
---|---|
4 public final class Luan { | 4 public final class Luan { |
5 public static final String version = "Luan 0.1"; | 5 public static final String version = "Luan 0.1"; |
6 | 6 |
7 public static String type(Object obj) { | 7 public static String type(Object obj) { |
8 if( obj == null ) | 8 if( obj == null ) |
9 return "Nil"; | 9 return "nil"; |
10 if( obj instanceof String ) | 10 if( obj instanceof String ) |
11 return "String"; | 11 return "string"; |
12 if( obj instanceof Boolean ) | 12 if( obj instanceof Boolean ) |
13 return "Boolean"; | 13 return "boolean"; |
14 if( obj instanceof Number ) | 14 if( obj instanceof Number ) |
15 return "Number"; | 15 return "number"; |
16 if( obj instanceof LuanTable ) | 16 if( obj instanceof LuanTable ) |
17 return "Table"; | 17 return "table"; |
18 if( obj instanceof LuanFunction ) | 18 if( obj instanceof LuanFunction ) |
19 return "Function"; | 19 return "function"; |
20 return "Userdata"; | 20 return "userdata"; |
21 } | 21 } |
22 | 22 |
23 public static boolean toBoolean(Object obj) { | 23 public static boolean toBoolean(Object obj) { |
24 return obj != null && !Boolean.FALSE.equals(obj); | 24 return obj != null && !Boolean.FALSE.equals(obj); |
25 } | 25 } |