CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-scala-native--auxlib-native0-5-3

Auxiliary libraries for Scala Native runtime providing essential runtime support including boxed types, concurrent collections, and utility functions

Pending
Overview
Eval results
Files

array-runtime.mddocs/

Array Runtime Support

Array cloning utilities supporting all primitive array types and object arrays with proper type preservation. The ArrayRuntime object provides essential array operations for the Scala Native runtime system.

Core Imports

import scala.runtime.ArrayRuntime

Capabilities

Array Cloning

Creates shallow copies of arrays for all primitive types and object arrays.

object ArrayRuntime {
  def cloneArray(array: Array[Boolean]): Array[Boolean]
  def cloneArray(array: Array[Byte]): Array[Byte]
  def cloneArray(array: Array[Short]): Array[Short]
  def cloneArray(array: Array[Char]): Array[Char]
  def cloneArray(array: Array[Int]): Array[Int]
  def cloneArray(array: Array[Long]): Array[Long]
  def cloneArray(array: Array[Float]): Array[Float]
  def cloneArray(array: Array[Double]): Array[Double]
  def cloneArray(array: Array[java.lang.Object]): Array[java.lang.Object]
}

Usage Examples

import scala.runtime.ArrayRuntime

// Clone primitive arrays
val intArray = Array(1, 2, 3, 4, 5)
val clonedIntArray = ArrayRuntime.cloneArray(intArray)

val doubleArray = Array(1.0, 2.0, 3.0)
val clonedDoubleArray = ArrayRuntime.cloneArray(doubleArray)

// Clone object arrays
val stringArray = Array("hello", "world")
val clonedStringArray = ArrayRuntime.cloneArray(stringArray.asInstanceOf[Array[java.lang.Object]])

// The cloned arrays are independent
clonedIntArray(0) = 100
println(intArray(0))       // 1 (original unchanged)
println(clonedIntArray(0)) // 100 (clone modified)

Notes

  • All cloneArray methods perform shallow copying
  • For object arrays, only the array container is cloned, not the contained objects
  • The cloned arrays are completely independent of the original arrays
  • Type preservation is maintained through method overloading

Install with Tessl CLI

npx tessl i tessl/maven-org-scala-native--auxlib-native0-5-3

docs

array-runtime.md

boxing-unboxing.md

concurrent-collections.md

index.md

mathematical-support.md

reference-types.md

tile.json