diff options
-rw-r--r-- | frontend/_aconcat.dcl | 24 | ||||
-rw-r--r-- | frontend/_aconcat.icl | 24 | ||||
-rw-r--r-- | frontend/classify.icl | 2 | ||||
-rw-r--r-- | frontend/containers.icl | 18 | ||||
-rw-r--r-- | frontend/explicitimports.icl | 2 | ||||
-rw-r--r-- | frontend/frontend.icl | 12 | ||||
-rw-r--r-- | frontend/generics1.icl | 2 | ||||
-rw-r--r-- | frontend/hashtable.icl | 18 | ||||
-rw-r--r-- | frontend/typesupport.dcl | 4 | ||||
-rw-r--r-- | frontend/typesupport.icl | 4 | ||||
-rw-r--r-- | frontend/unitype.icl | 14 |
11 files changed, 54 insertions, 70 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 diff --git a/frontend/_aconcat.icl b/frontend/_aconcat.icl index 4bd758f..4dd6a92 100644 --- a/frontend/_aconcat.icl +++ b/frontend/_aconcat.icl @@ -43,22 +43,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 diff --git a/frontend/classify.icl b/frontend/classify.icl index d7c18bc..25b8837 100644 --- a/frontend/classify.icl +++ b/frontend/classify.icl @@ -1409,7 +1409,7 @@ substitute_dep_counts component_members ai_group_counts where build_known :: !*{!RefCounts} -> (!*{*{#Bool}},!*{!RefCounts}) build_known t - = arrayAndElementsCopy {} (\e->(createArray (size e) False,e)) t + = arrayAndElementsCopy (\e->(createArray (size e) False,e)) t subst_non_zero :: ![(!FunIndex,!ArgIndex)] !FunIndex !ArgIndex !FunIndex !ArgIndex !*{*{#Bool}} !*{!RefCounts}-> *{!RefCounts} subst_non_zero iter fi ai fm am known rcs diff --git a/frontend/containers.icl b/frontend/containers.icl index 6b1cd08..2b2bd8b 100644 --- a/frontend/containers.icl +++ b/frontend/containers.icl @@ -387,14 +387,11 @@ ikhInsert :: !Bool !IntKey a !*(IntKeyHashtable a) -> (!Bool, !.IntKeyHashtable ikhInsert overide int_key value (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries) | ikh_rehash_threshold<=ikh_nr_of_entries = ikhInsert overide int_key value (grow ikh_entries) - #! hash_value - = int_key bitand ikh_bitmask - (tree, ikh_entries) - = replace ikh_entries hash_value IKT_Leaf + #! hash_value = int_key bitand ikh_bitmask + (tree, ikh_entries) = ikh_entries![hash_value] (is_new, tree) = iktUInsert overide int_key value tree - ikh_entries - = { ikh_entries & [hash_value] = tree } + ikh_entries = { ikh_entries & [hash_value] = tree } | is_new = (is_new, (IntKeyHashtable ikh_rehash_threshold (ikh_nr_of_entries+1) ikh_bitmask ikh_entries)) = (is_new, (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries)) @@ -444,14 +441,11 @@ ikhUSearch :: !IntKey !*(IntKeyHashtable a) -> (!.Optional a, !*IntKeyHashtable ikhUSearch int_key (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries) | size ikh_entries==0 = (No, IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries) - # hash_value - = int_key bitand ikh_bitmask - (ikt, ikh_entries) - = replace ikh_entries hash_value IKT_Leaf + # hash_value = int_key bitand ikh_bitmask + (ikt, ikh_entries) = ikh_entries![hash_value] (opt_result, ikt) = iktUSearch int_key ikt - ikh_entries - = { ikh_entries & [hash_value] = ikt } + ikh_entries = { ikh_entries & [hash_value] = ikt } = (opt_result, (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries)) iktUInsert :: !Bool !IntKey a !*(IntKeyTree a) -> (!Bool, !.IntKeyTree a) diff --git a/frontend/explicitimports.icl b/frontend/explicitimports.icl index 9e692e8..30a4638 100644 --- a/frontend/explicitimports.icl +++ b/frontend/explicitimports.icl @@ -21,7 +21,7 @@ implies a b :== not a || b markExplImpSymbols :: !Int !*(!*ExplImpInfos,!*SymbolTable) -> (!.[Ident],!(!*ExplImpInfos,!*SymbolTable)) markExplImpSymbols component_nr (expl_imp_info, cs_symbol_table) - # (expl_imp_info_from_component,expl_imp_info) = replace expl_imp_info component_nr {} + # (expl_imp_info_from_component,expl_imp_info) = expl_imp_info![component_nr] #! nr_of_expl_imp_symbols = size expl_imp_info_from_component # (new_symbols, expl_imp_info_from_component, cs_symbol_table) = iFoldSt (mark_symbol component_nr) 0 nr_of_expl_imp_symbols ([], expl_imp_info_from_component, cs_symbol_table) expl_imp_info = {expl_imp_info & [component_nr] = expl_imp_info_from_component} diff --git a/frontend/frontend.icl b/frontend/frontend.icl index b937148..b961fa6 100644 --- a/frontend/frontend.icl +++ b/frontend/frontend.icl @@ -284,16 +284,16 @@ frontEndInterface options mod_ident search_paths cached_dcl_modules cached_dcl_m clear_group_indices_of_macros :: !*{#*{#FunDef}} -> *{#*{#FunDef}} clear_group_indices_of_macros cached_dcl_macros - = clear_group_indices1 0 {} cached_dcl_macros + = clear_group_indices1 0 cached_dcl_macros where - clear_group_indices1 :: !Int !*{#FunDef} !*{#*{#u:FunDef}} -> *{#*{#FunDef}} - clear_group_indices1 i dummy cached_dcl_macros + clear_group_indices1 :: !Int !*{#*{#u:FunDef}} -> *{#*{#FunDef}} + clear_group_indices1 i cached_dcl_macros | i==size cached_dcl_macros = cached_dcl_macros - # (cached_dcl_macros_i,cached_dcl_macros) = replace cached_dcl_macros i dummy + # (cached_dcl_macros_i,cached_dcl_macros) = cached_dcl_macros![i] # cached_dcl_macros_i = clear_group_indices2 0 cached_dcl_macros_i - # (dummy,cached_dcl_macros) = replace cached_dcl_macros i cached_dcl_macros_i - = clear_group_indices1 (i+1) dummy cached_dcl_macros + # cached_dcl_macros = {cached_dcl_macros & [i]=cached_dcl_macros_i} + = clear_group_indices1 (i+1) cached_dcl_macros clear_group_indices2 j cached_dcl_macros_i | j==size cached_dcl_macros_i diff --git a/frontend/generics1.icl b/frontend/generics1.icl index 8fbd05d..2468b76 100644 --- a/frontend/generics1.icl +++ b/frontend/generics1.icl @@ -160,7 +160,7 @@ where clear_modules n td_infos | n == size td_infos = td_infos - #! (td_infos1, td_infos) = replace td_infos n {} + #! (td_infos1, td_infos) = td_infos![n] #! td_infos1 = clear_td_infos 0 td_infos1 #! td_infos = {td_infos & [n]=td_infos1} = clear_modules (inc n) td_infos diff --git a/frontend/hashtable.icl b/frontend/hashtable.icl index 0df5802..934bbfc 100644 --- a/frontend/hashtable.icl +++ b/frontend/hashtable.icl @@ -90,7 +90,7 @@ where putIdentInHashTable :: !String !IdentClass !*HashTable -> (!BoxedIdent, !*HashTable) putIdentInHashTable name ident_class {hte_symbol_heap,hte_entries,hte_mark} # hash_val = hashValue name - (entries,hte_entries) = replace hte_entries hash_val HTE_Empty + (entries,hte_entries) = hte_entries![hash_val] (ident, hte_symbol_heap, entries) = insert name ident_class hte_mark hte_symbol_heap entries hte_entries = {hte_entries & [hash_val]=entries} = (ident, { hte_symbol_heap = hte_symbol_heap, hte_entries = hte_entries,hte_mark=hte_mark }) @@ -114,9 +114,9 @@ where putQualifiedIdentInHashTable :: !String !BoxedIdent !IdentClass !*HashTable -> (!BoxedIdent, !*HashTable) putQualifiedIdentInHashTable module_name ident ident_class {hte_symbol_heap,hte_entries,hte_mark} # hash_val = hashValue module_name - (entries,hte_entries) = replace hte_entries hash_val HTE_Empty + (entries,hte_entries) = hte_entries![hash_val] (ident, hte_symbol_heap, entries) = insert module_name ident ident_class (IC_Module NoQualifiedIdents) hte_mark hte_symbol_heap entries - hte_entries = update hte_entries hash_val entries + hte_entries = {hte_entries & [hash_val]=entries} = (ident, { hte_symbol_heap = hte_symbol_heap, hte_entries = hte_entries,hte_mark=hte_mark }) where insert :: !String !BoxedIdent !IdentClass !IdentClass !Int !*SymbolTable *HashTableEntry -> (!BoxedIdent, !*SymbolTable, !*HashTableEntry) @@ -141,9 +141,9 @@ where putPredefinedIdentInHashTable :: !Ident !IdentClass !*HashTable -> *HashTable putPredefinedIdentInHashTable predefined_ident=:{id_name} ident_class {hte_symbol_heap,hte_entries,hte_mark} # hash_val = hashValue id_name - (entries,hte_entries) = replace hte_entries hash_val HTE_Empty + (entries,hte_entries) = hte_entries![hash_val] (hte_symbol_heap, entries) = insert id_name ident_class hte_mark hte_symbol_heap entries - hte_entries = update hte_entries hash_val entries + hte_entries = {hte_entries & [hash_val]=entries} = { hte_symbol_heap = hte_symbol_heap, hte_entries = hte_entries,hte_mark=hte_mark } where insert :: !String !IdentClass !Int !*SymbolTable *HashTableEntry -> (!*SymbolTable, !*HashTableEntry) @@ -164,9 +164,9 @@ where get_qualified_idents_from_hash_table :: !Ident !*HashTable -> (!QualifiedIdents,!*HashTable) get_qualified_idents_from_hash_table module_ident=:{id_name} hash_table=:{hte_entries} # hash_val = hashValue id_name - (entries,hte_entries) = replace hte_entries hash_val HTE_Empty + (entries,hte_entries) = hte_entries![hash_val] (qualified_idents, entries) = find_qualified_idents id_name (IC_Module NoQualifiedIdents) entries - hte_entries = update hte_entries hash_val entries + hte_entries = {hte_entries & [hash_val] = entries} = (qualified_idents, {hash_table & hte_entries = hte_entries}) where find_qualified_idents :: !String !IdentClass *HashTableEntry -> (!QualifiedIdents, !*HashTableEntry) @@ -188,9 +188,9 @@ remove_icl_symbols_from_hash_table hash_table=:{hte_entries} where remove_icl_symbols_from_array i hte_entries | i<size hte_entries - # (entries,hte_entries) = replace hte_entries i HTE_Empty + # (entries,hte_entries) = hte_entries![i] # (_,entries) = remove_icl_entries_from_tree entries - # hte_entries = update hte_entries i entries + # hte_entries = {hte_entries & [i] = entries} = remove_icl_symbols_from_array (i+1) hte_entries = hte_entries diff --git a/frontend/typesupport.dcl b/frontend/typesupport.dcl index 22664a5..841c844 100644 --- a/frontend/typesupport.dcl +++ b/frontend/typesupport.dcl @@ -100,7 +100,7 @@ accCoercionTree f i coercion_trees :== acc_coercion_tree i coercion_trees where acc_coercion_tree i coercion_trees - # (coercion_tree, coercion_trees) = replace coercion_trees i CT_Empty + # (coercion_tree, coercion_trees) = coercion_trees![i] (x, coercion_tree) = f coercion_tree = (x, {coercion_trees & [i]=coercion_tree}) @@ -109,7 +109,7 @@ appCoercionTree f i coercion_trees :== acc_coercion_tree i coercion_trees where acc_coercion_tree i coercion_trees - # (coercion_tree, coercion_trees) = replace coercion_trees i CT_Empty + # (coercion_tree, coercion_trees) = coercion_trees![i] = {coercion_trees & [i] = f coercion_tree} class performOnTypeVars a :: !(TypeAttribute TypeVar .st -> .st) !a !.st -> .st diff --git a/frontend/typesupport.icl b/frontend/typesupport.icl index b7e713e..3bd5cdd 100644 --- a/frontend/typesupport.icl +++ b/frontend/typesupport.icl @@ -1739,7 +1739,7 @@ accCoercionTree f i coercion_trees :== acc_coercion_tree i coercion_trees where acc_coercion_tree i coercion_trees - # (coercion_tree, coercion_trees) = replace coercion_trees i CT_Empty + # (coercion_tree, coercion_trees) = coercion_trees![i] (x, coercion_tree) = f coercion_tree = (x, {coercion_trees & [i]=coercion_tree}) @@ -1747,7 +1747,7 @@ appCoercionTree f i coercion_trees :== acc_coercion_tree i coercion_trees where acc_coercion_tree i coercion_trees - # (coercion_tree, coercion_trees) = replace coercion_trees i CT_Empty + # (coercion_tree, coercion_trees) = coercion_trees![i] = {coercion_trees & [i] = f coercion_tree} flattenCoercionTree :: !u:CoercionTree -> (![Int], !u:CoercionTree) diff --git a/frontend/unitype.icl b/frontend/unitype.icl index c830086..9114daf 100644 --- a/frontend/unitype.icl +++ b/frontend/unitype.icl @@ -164,7 +164,6 @@ where = combine_coercion_trees group_index attrs partition merged_tree coer_offered coer_demanded combine_coercion_trees group_index [ ] partition merged_tree coer_offered coer_demanded = (merged_tree, coer_demanded) - rebuild_tree :: !Index !AttributePartition !*CoercionTree !*CoercionTree -> *CoercionTree rebuild_tree group_index partition (CT_Node attr left right) tree @@ -669,13 +668,13 @@ coerceAttributes off_attr dem_attr _ coercions newInequality :: !Int !Int !*Coercions -> *Coercions newInequality off_attr dem_attr coercions=:{coer_demanded, coer_offered} - # (dem_coercions, coer_demanded) = replace coer_demanded off_attr CT_Empty + # (dem_coercions, coer_demanded) = coer_demanded![off_attr] (succ, dem_coercions) = insert dem_attr dem_coercions - coer_demanded = { coer_demanded & [off_attr] = dem_coercions } + coer_demanded = {coer_demanded & [off_attr] = dem_coercions} | succ - # (off_coercions, coer_offered) = replace coer_offered dem_attr CT_Empty + # (off_coercions, coer_offered) = coer_offered![dem_attr] (succ, off_coercions) = insert off_attr off_coercions - coer_offered = { coer_offered & [dem_attr] = off_coercions } + coer_offered = {coer_offered & [dem_attr] = off_coercions} = {coer_demanded = coer_demanded, coer_offered = coer_offered} = {coer_demanded = coer_demanded, coer_offered = coer_offered} where @@ -716,9 +715,8 @@ makeUnique :: !Int !*Coercions -> *Coercions makeUnique attr {coer_demanded, coer_offered} # (off_coercions, coer_offered) = replace coer_offered attr CT_Empty coer_demanded = { coer_demanded & [attr] = CT_Unique } - = make_unique off_coercions {coer_offered = coer_offered, coer_demanded = coer_demanded}// ---> ("makeUnique :", attr) + = make_unique off_coercions {coer_offered = coer_offered, coer_demanded = coer_demanded} where - // JVG added type: make_unique :: !CoercionTree !*Coercions -> *Coercions; make_unique (CT_Node this_attr ct_less ct_greater) coercions # coercions = makeUnique this_attr coercions @@ -989,7 +987,7 @@ copyCoercions coercions=:{coer_demanded, coer_offered} = ({coercions & coer_demanded = coer_demanded, coer_offered = coer_offered}, {coercions & coer_demanded = coer_demanded_copy, coer_offered = coer_offered_copy}) where copy_coercion_trees trees - = arrayAndElementsCopy CT_Empty copy_coercion_tree trees + = arrayAndElementsCopy copy_coercion_tree trees copy_coercion_tree (CT_Node attr left right) # (copy_left, left) = copy_coercion_tree left |