diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml index fcb9cffe5..21d73669e 100644 --- a/.idea/libraries/KotlinJavaRuntime.xml +++ b/.idea/libraries/KotlinJavaRuntime.xml @@ -1,23 +1,23 @@ - + - - + + - + - - + + - + - - + + - + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 28cabb4df..e1fe46ddd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion plugins { - kotlin("jvm") version "2.2.20" + kotlin("jvm") version "2.2.21" } allprojects { diff --git a/docs/source/libraries.rst b/docs/source/libraries.rst index 416b04b4f..68682196e 100644 --- a/docs/source/libraries.rst +++ b/docs/source/libraries.rst @@ -38,6 +38,17 @@ There's a set of predefined functions in the language. These are fixed and can't You can use them in expressions and the compiler will evaluate them at compile-time if possible. +Array operations +^^^^^^^^^^^^^^^^ + +len (x) + Number of values in the array value x, or the number of characters in a string (excluding the 0-byte). + Note: this can be different from the number of *bytes* in memory if the datatype isn't a byte. See sizeof(). + Note: lengths of strings and arrays are determined at compile-time! If your program modifies the actual + length of the string during execution, the value of len(s) may no longer be correct! + (use the ``strings.length`` routine if you want to dynamically determine the length by counting to the + first 0-byte) + Math ^^^^ @@ -70,18 +81,6 @@ sqrt (x) To do the reverse - squaring a number - just write ``x*x``. -Array operations -^^^^^^^^^^^^^^^^ - -len (x) - Number of values in the array value x, or the number of characters in a string (excluding the 0-byte). - Note: this can be different from the number of *bytes* in memory if the datatype isn't a byte. See sizeof(). - Note: lengths of strings and arrays are determined at compile-time! If your program modifies the actual - length of the string during execution, the value of len(s) may no longer be correct! - (use the ``strings.length`` routine if you want to dynamically determine the length by counting to the - first 0-byte) - - Miscellaneous ^^^^^^^^^^^^^ diff --git a/docs/source/todo.rst b/docs/source/todo.rst index b06a06c8e..46b91ef7f 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -28,7 +28,7 @@ Future Things and Ideas - improve ANTLR grammar with better error handling (as suggested by Qwen AI) - add documentation for more library modules instead of just linking to the source code - add an Index to the documentation -- allow memory() to occur in array initializer (maybe needed for 2 dimensional arrays?) +- allow memory() to occur in array initializer (maybe needed for 2 dimensional arrays?) i.e. make it a constant (see github issue #192) - Two- or even multidimensional arrays and chained indexing, purely as syntactic sugar over regular arrays? - when a complete block is removed because unused, suppress all info messages about everything in the block being removed - is "checkAssignmentCompatible" redundant (gets called just 1 time!) when we also have "checkValueTypeAndRange" ?