Pick.search.cite: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/correctness/pick.bend as Pick Lines 209-218 of bolt@1.27.0.0/src/rules/correctness/pick.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/correctness/pick.bend&start_line=209&end_line=218 import Base import bolt@1.27.0.0/src/finding.bend as F # the finding at the bound self-call; tail: the else branch is the bound # name alone, so the call can carry the test instead def search.cite(+ll: U32, +cc: U32, +name: String, +path: String, tail: Bool) -> F.Finding: match tail: case True{}: F.Finding{path, ll, cc, U32.from_nat(String.length(name)), "pick", name ++ " binds its own call above a Bool.pick that reads it only in the else branch, so the walk runs even when the condition holds and the search never stops early; carry the test as a Bool into the next call (`go(rest, k, test(h))`) and `match hit` first, so the search stops and stays a loop."} case False{}: F.Finding{path, ll, cc, U32.from_nat(String.length(name)), "pick", name ++ " binds its own call above a Bool.pick that reads it only in the else branch, so the walk runs even when the condition holds and the search never stops early; branch with `match` on the condition in a helper that takes it as a parameter, so the call runs only in the branch that needs it."} Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/finding.bend&name=Finding