aboutsummaryrefslogtreecommitdiff
path: root/frontend/_aconcat.icl
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/_aconcat.icl')
-rw-r--r--frontend/_aconcat.icl40
1 files changed, 40 insertions, 0 deletions
diff --git a/frontend/_aconcat.icl b/frontend/_aconcat.icl
new file mode 100644
index 0000000..67caf59
--- /dev/null
+++ b/frontend/_aconcat.icl
@@ -0,0 +1,40 @@
+implementation module _aconcat
+
+import _SystemArray,StdInt,StdEnum, StdList
+
+arrayConcat a1 a2
+ :==r2
+where
+ r2={r1 & [i+s1]=a2.[i] \\ i<-[0..s2-1]}
+ r1={r0 & [i]=a1.[i] \\ i<-[0..s1-1]}
+ r0=_createArrayc (s1+s2)
+ s1=size a1
+ s2=size a2
+
+arrayPlusList a l
+ :==r2
+where
+ r2={r1 & [i+s1]=e \\ i<-[0..s2-1] & e <- l}
+ r1={r0 & [i]=a.[i] \\ i<-[0..s1-1]}
+ r0=_createArrayc (s1+s2)
+ s1=size a
+ s2=length l
+/*
+ :== case l of
+ []
+ -> a
+ _
+ -> arrayConcat a { x \\ x <- l }
+*/
+
+arrayPlusRevList a l
+ :==r2
+where
+ r2={r1 & [sr-i]=e \\ i<-[1..s2] & e<-l}
+ r1={r0 & [i]=a.[i] \\ i<-[0..s1-1]}
+ r0=_createArrayc sr
+ sr=s1+s2
+ s1=size a
+ s2=length l
+
+