Rename split-loop-with-lambda to slice-with-lambda
The refactoring is now published as Slice on sammancoaching.org: https://sammancoaching.org/refactorings/slice.html - git mv ideas/split-loop-with-lambda -> ideas/slice-with-lambda - rename learning-hour file and update frontmatter name - update paths in tools/rehearse scripts and report title - update prose: 'Split Loop with Lambda' -> 'Slice with Lambda' in learning hour, exercise READMEs, storyboard, solution comments - link the published Slice refactoring from the pattern draft
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 460" font-family="Helvetica, Arial, sans-serif">
|
||||
<defs>
|
||||
<marker id="arrR" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M0,0 L10,5 L0,10 z" fill="#dc2626"/>
|
||||
</marker>
|
||||
<marker id="arrG" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
||||
<path d="M0,0 L10,5 L0,10 z" fill="#475569"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="760" height="460" fill="#ffffff"/>
|
||||
<text x="24" y="34" font-size="20" font-weight="bold" fill="#0f172a">Step 1 — an approval test: red & flaky</text>
|
||||
<text x="24" y="56" font-size="13" fill="#475569">Capture System.out, Approvals.verify it. Every run disagrees — Scorer re-rolls with a Random.</text>
|
||||
|
||||
<!-- test -->
|
||||
<rect x="50" y="140" width="240" height="140" rx="10" fill="#ffffff" stroke="#94a3b8" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||||
<text x="66" y="166" font-size="13" font-weight="bold" fill="#334155">DailyForecastsTest</text>
|
||||
<text x="66" y="192" font-size="11" font-family="Menlo, Consolas, monospace" fill="#334155">capture System.out</text>
|
||||
<text x="66" y="212" font-size="11" font-family="Menlo, Consolas, monospace" fill="#334155">Approvals.verify(...)</text>
|
||||
<text x="66" y="248" font-size="12" font-weight="bold" fill="#dc2626">red & flaky ✗</text>
|
||||
|
||||
<!-- method -->
|
||||
<rect x="380" y="100" width="330" height="180" rx="10" fill="#f8fafc" stroke="#64748b" stroke-width="1.5"/>
|
||||
<text x="396" y="124" font-size="13" font-weight="bold" fill="#0f172a">printSalesForecasts()</text>
|
||||
<rect x="396" y="138" width="298" height="126" rx="8" fill="#eef2ff" stroke="#818cf8"/>
|
||||
<text x="410" y="162" font-size="11" font-family="Menlo, Consolas, monospace" fill="#1e1b4b">for (String name : names)</text>
|
||||
<text x="410" y="186" font-size="11" font-family="Menlo, Consolas, monospace" font-weight="bold" fill="#dc2626">Scorer.flavour = ... / updateSelection()</text>
|
||||
<text x="410" y="210" font-size="11" font-family="Menlo, Consolas, monospace" font-weight="bold" fill="#dc2626">score = scorer.getSalesForecast();</text>
|
||||
<text x="410" y="238" font-size="11" font-family="Menlo, Consolas, monospace" fill="#d97706">System.out.println(...)</text>
|
||||
|
||||
<line x1="294" y1="210" x2="372" y2="190" stroke="#475569" stroke-width="1.5" marker-end="url(#arrG)"/>
|
||||
|
||||
<!-- Scorer -->
|
||||
<rect x="560" y="330" width="170" height="70" rx="8" fill="#fef2f2" stroke="#dc2626" stroke-width="1.5"/>
|
||||
<text x="645" y="358" font-size="12" font-weight="bold" fill="#dc2626" text-anchor="middle">Scorer</text>
|
||||
<text x="645" y="378" font-size="10" fill="#7f1d1d" text-anchor="middle">Random → different every run</text>
|
||||
<line x1="645" y1="328" x2="645" y2="286" stroke="#dc2626" stroke-width="1.5" stroke-dasharray="5 4" marker-end="url(#arrR)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
Reference in New Issue
Block a user