diff options
author | johnvg | 2011-04-19 11:37:59 +0000 |
---|---|---|
committer | johnvg | 2011-04-19 11:37:59 +0000 |
commit | d0ae22e4b794606ef99dc124b8b40a93cc24f9ba (patch) | |
tree | e880d814aef67ca23e44808a4b30f054606dbc13 /frontend/_aconcat.dcl | |
parent | add instance declarations with a qualified class name (diff) |
use unique array select and update instead of replace
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1930 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/_aconcat.dcl')
-rw-r--r-- | frontend/_aconcat.dcl | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/frontend/_aconcat.dcl b/frontend/_aconcat.dcl index 6fcb387..a5b6e98 100644 --- a/frontend/_aconcat.dcl +++ b/frontend/_aconcat.dcl @@ -44,22 +44,18 @@ where arrayCopy a :== arrayCopyBegin a1 s where - (s, a1) - = usize a + (s, a1) = usize a -arrayAndElementsCopy place_holder copy_element_function array - :== copy place_holder array1 (_createArray n) 0 n +arrayAndElementsCopy copy_element_function array + :== copy array1 (_createArray n) 0 n where - (n, array1) - = usize array - copy place_holder array array_copy i n + (n, array1) = usize array + + copy array array_copy i n | i == n - = (array_copy, array) - // otherwise - # (element, array) - = replace array i place_holder + = (array_copy, array) + # (element, array) = array![i] # (copy_element, element) = copy_element_function element - # (place_holder, array) - = replace array i element - = copy place_holder array {array_copy & [i] = copy_element} (i+1) n + # array = {array & [i] = element} + = copy array {array_copy & [i] = copy_element} (i+1) n |