Skip to content

Commit 2cd0165

Browse files
committed
rt: Add a method to allow type checking at runtime.
1 parent 94dc668 commit 2cd0165

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/piccode/rt/PiccodeValue.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ public static Type of(PiccodeValue value) {
4343
if (value instanceof PiccodeBoolean) return BOOLEAN;
4444
if (value instanceof PiccodeObject ) return OBJECT;
4545
if (value instanceof PiccodeTuple ) return TYPLE;
46+
if (value instanceof PiccodeArray ) return ARRAY;
4647
if (value instanceof PiccodeClosure) return CLOSURE;
48+
if (value instanceof PiccodeUnit ) return UNIT;
49+
if (value instanceof NativeFunction) return NATIVEFUNCTION;
50+
51+
System.out.println(value + " : " + value.getClass());
4752
return VALUE;
4853
}
4954
}

0 commit comments

Comments
 (0)