diff --git a/ISBPL.java b/ISBPL.java index 4036019..637d15e 100644 --- a/ISBPL.java +++ b/ISBPL.java @@ -1978,7 +1978,6 @@ public class ISBPL { } private static String readFile(File f) throws IOException { - //noinspection resource FileInputStream fis = new FileInputStream(f); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); byte[] currentBytes = new byte[4096]; @@ -1986,6 +1985,7 @@ public class ISBPL { while ((len = fis.read(currentBytes)) > 0) { bytes.write(currentBytes, 0, len); } + fis.close(); return bytes.toString(); } diff --git a/docs/base/std.md b/docs/base/std.md index 125aaf4..24e741b 100644 --- a/docs/base/std.md +++ b/docs/base/std.md @@ -647,12 +647,6 @@ - -## >TYPE_SHADOW - - - - -### Methods - ## >TYPE_INT - @@ -669,36 +663,6 @@ - -## >TYPE_BYTE - - - - -### Methods - -## >TYPE_FUNCTION - - - - -### Methods - -## >TYPE_FLOAT - - - - -### Methods - -## >TYPE_NULL - - - - -### Methods - -## >TYPE_LONG - - - - -### Methods - ## >TYPE_STRING - @@ -740,11 +704,21 @@ - +#### `aput ::: -> ` + + - + + #### `stackTraceToString ::: -> ` - +#### `aget ::: -> ` + + - + + #### `construct ::: -> ` - @@ -783,11 +757,21 @@ - +#### `aput ::: -> ` + + - + + #### `stackTraceToString ::: -> ` - +#### `aget ::: -> ` + + - + + #### `construct ::: -> ` - diff --git a/docs/std.md b/docs/std.md index 577f4fe..fc4d029 100644 --- a/docs/std.md +++ b/docs/std.md @@ -712,11 +712,21 @@ over type definitions, to string processing. Iterates through this array and calls the callable with the object (NOT the index). +#### `aput ::: item idx -> ` + + Puts an item into the array + + #### `stackTraceToString ::: -> string` Converts this array to a stack trace string. Only use on compatible arrays! +#### `aget ::: idx -> item` + + Gets an item from the array + + #### `construct ::: length -> array` Constructs an array with a length diff --git a/std.isbpl b/std.isbpl index 265ed79..b758a20 100644 --- a/std.isbpl +++ b/std.isbpl @@ -122,6 +122,8 @@ def Error construct error { } } =Error +def __aput_native &aput =__aput_native + def TYPE_ARRAY construct array { ; construct { @@ -150,6 +152,14 @@ def TYPE_ARRAY construct array { } this foreach s } + ? { + with idx this ; + this idx aget + } + =? { + with item idx this ; + this idx item aput + } } =TYPE_ARRAY def Array TYPE_ARRAY =Array def TYPE_STRING construct string array {