aboutsummaryrefslogtreecommitdiff
path: root/tests/lang/eval-okay-replacestrings.exp
diff options
context:
space:
mode:
authorpolykernel <81340136+polykernel@users.noreply.github.com>2023-05-25 00:37:00 -0400
committerpolykernel <81340136+polykernel@users.noreply.github.com>2023-05-25 18:35:23 -0400
commita382919d7dd696c01c0d5abd04222c2821c0a49d (patch)
tree6cd7443c919cd037c54f10e559ee3cd748b619f9 /tests/lang/eval-okay-replacestrings.exp
parent6e4570234d5ac63a9483fb7f7aabaa1d17561a3a (diff)
primops: lazy evaluation of replaceStrings replacements
The primop `builtins.replaceStrings` currently always strictly evaluates the replacement strings, however time and space are wasted for their computation if the corresponding pattern do not occur in the input string. This commit makes the evaluation of the replacement strings lazy by deferring their evaluation to when the corresponding pattern are matched and memoize the result for efficient retrieval on subsequent matches. The testcases for replaceStrings was updated to check for lazy evaluation of the replacements. A note was also added in the release notes to document the behavior change.
Diffstat (limited to 'tests/lang/eval-okay-replacestrings.exp')
-rw-r--r--tests/lang/eval-okay-replacestrings.exp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/lang/eval-okay-replacestrings.exp b/tests/lang/eval-okay-replacestrings.exp
index 72e8274d8..eac67c5fe 100644
--- a/tests/lang/eval-okay-replacestrings.exp
+++ b/tests/lang/eval-okay-replacestrings.exp
@@ -1 +1 @@
-[ "faabar" "fbar" "fubar" "faboor" "fubar" "XaXbXcX" "X" "a_b" ]
+[ "faabar" "fbar" "fubar" "faboor" "fubar" "XaXbXcX" "X" "a_b" "fubar" ]