]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.runtime/scl/Prelude.scl
Getting rid of *Array and replace with Vector * (SCL)
[simantics/platform.git] / bundles / org.simantics.scl.runtime / scl / Prelude.scl
index eb8026de910e15f2b8900c2e0fce6a6d6a0d0d6e..cce9064090ca123545e387b711e7cab902e95680 100644 (file)
@@ -38,6 +38,15 @@ class Serializable a
 binding :: Serializable a => Binding a
 ***********************************************************/
 
+type BooleanArray = Vector Boolean
+type ByteArray = Vector Byte
+type CharacterArray = Vector Character
+type ShortArray = Vector Short
+type IntegerArray = Vector Integer
+type LongArray = Vector Long
+type FloatArray = Vector Float
+type DoubleArray = Vector Double
+
 importJava "java.util.Arrays" where
     @private
     @JavaName toString
@@ -1421,6 +1430,11 @@ importJava "java.lang.String" where
     "Creates a string from a vector of characters."
     @JavaName "<init>"
     string :: Vector Character -> String
+    
+    getBytes :: String -> String -> ByteArray
+
+getBytesUTF8 :: String -> ByteArray
+getBytesUTF8 str = getBytes str "UTF-8"
 
 instance Ord String where
     compare = compareString