in search-list.sml: fix 'delRightFromHere' and 'delLeftFromHere' functions which joined newHd with left/right, rather than the tl, and therefore added new numbers to the list, which is incorrect behaviour. Fixed this by using joining with 'tl' rather than left/right. In build-search-list.sml: make fromRange function return tuple instead of an instance of app. Finally, in app-update.sml: progress towards refactoring 'helpRemoveChr' function to map and delete from searchList as desired.

This commit is contained in:
2024-11-17 09:25:01 +00:00
parent f7cc2d4740
commit e90df37b43
4 changed files with 26 additions and 12 deletions

View File

@@ -9,6 +9,7 @@ sig
val goToNum: int * t -> t
val mapFrom: int * int * t -> t
val printlst: t -> unit
end
structure SearchList :> SEARCH_LIST =
@@ -233,7 +234,7 @@ struct
val newHd = VectorSlice.slice (hd, delstart, SOME dellength)
val newHd = VectorSlice.vector newHd
in
{left = left, right = joinStartOfRight (newHd, right)}
{left = left, right = joinStartOfRight (newHd, tl)}
end
else
(* finish = last *)
@@ -317,7 +318,7 @@ struct
val newHd = VectorSlice.slice (hd, delpoint, SOME newLength)
val newHd = VectorSlice.vector newHd
in
{left = joinEndOfLeft (newHd, left), right = right}
{left = joinEndOfLeft (newHd, tl), right = right}
end
else
(* start = first *)