lix/src/libexpr
polykernel a382919d7d
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.
2023-05-25 18:35:23 -04:00
..
flake Merge remote-tracking branch 'origin/master' into source-path 2023-04-24 13:20:36 +02:00
primops Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
tests primops: lazy evaluation of replaceStrings replacements 2023-05-25 18:35:23 -04:00
value Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
attr-path.cc Merge remote-tracking branch 'origin/master' into source-path 2023-04-24 13:20:36 +02:00
attr-path.hh Merge remote-tracking branch 'upstream/master' into source-path 2023-04-17 11:41:50 +02:00
attr-set.cc Don't pass Symbol by reference 2022-04-26 13:25:17 +02:00
attr-set.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
eval-cache.cc Formatting 2023-04-25 16:52:02 +02:00
eval-cache.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
eval-inline.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
eval.cc Upgrade downstreamPlaceholder to a type with methods 2023-05-17 17:41:16 -04:00
eval.hh Upgrade downstreamPlaceholder to a type with methods 2023-05-17 17:41:16 -04:00
fetchurl.nix fetchurl.nix: change other use of __impure 2022-09-16 01:54:24 -07:00
function-trace.cc Revert the enum struct change 2020-06-18 22:11:26 +00:00
function-trace.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
get-drvs.cc Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
get-drvs.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
imported-drv-to-derivation.nix Move some corepkgs into the nix binary 2020-03-11 16:57:48 +01:00
json-to-value.cc return string_views from forceString* 2022-01-27 17:15:43 +01:00
json-to-value.hh Ensure all headers have #pragma once and are in API docs 2023-03-31 23:19:44 -04:00
lexer.l Handle EOFs in string literals correctly 2022-05-25 17:58:13 +02:00
local.mk Enable -Werror=switch-enum 2023-04-03 18:45:20 +02:00
nix-expr.pc.in Fix building with GCC 9 2023-02-10 18:38:57 +01:00
nixexpr.cc Merge remote-tracking branch 'upstream/master' into source-path 2023-04-17 11:41:50 +02:00
nixexpr.hh Merge remote-tracking branch 'upstream/master' into source-path 2023-04-17 11:41:50 +02:00
parser.y Origin: Use SourcePath 2023-04-06 15:25:06 +02:00
paths.cc Backport SourcePath from the lazy-trees branch 2023-04-06 13:15:50 +02:00
primops.cc primops: lazy evaluation of replaceStrings replacements 2023-05-25 18:35:23 -04:00
primops.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
print.cc libexpr: quote reserved keys when printing 2023-05-09 09:45:12 -05:00
print.hh libexpr: quote reserved keys when printing 2023-05-09 09:45:12 -05:00
symbol-table.hh Finish converting existing comments for internal API docs (#8146) 2023-04-07 13:55:28 +00:00
value-to-json.cc Merge remote-tracking branch 'origin/master' into source-path 2023-04-24 13:20:36 +02:00
value-to-json.hh Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
value-to-xml.cc Merge remote-tracking branch 'origin/master' into source-path 2023-04-24 13:20:36 +02:00
value-to-xml.hh Use std::set<StringContextElem> not PathSet for string contexts 2023-04-21 01:05:49 -04:00
value.hh Merge remote-tracking branch 'origin/master' into source-path 2023-04-24 13:20:36 +02:00