Files
learning-hour-maker/ideas/slice-with-lambda/exercise/rehearsal-runs/C+Q/measure.txt
T
Your Name 77ae05c28c 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
2026-09-29 15:47:30 +00:00

36 lines
1.5 KiB
Plaintext

--- Run C+Q ---
session file: /tmp/rehearsal/runs/C+Q/session/2026-09-27T15-53-02-700Z_01a0e391-ddec-76b3-83b6-8a55d163bf7c.jsonl
model: Qwen/Qwen3.6-35B-A3B
session span: 71.7 s
assistant messages: 16
tool calls: 17 total
bash 7
read 5
edit 5
tokens input: 138747
tokens output: 8337
tokens cacheRead: 0
tokens cacheWrite: 0
tokens reasoning: 2579
tokens TOTAL (sum): 149663
--- /usr/bin/time -v (wall clock + max RSS) ---
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:11.84
Maximum resident set size (kbytes): 226488
Exit status: 0
--- pi stdout (last 15 lines) ---
+ long daysForward = ChronoUnit.DAYS.between(forecastDate, date);
+ expectedWeather.add(dayOffsetToWeather.apply(daysForward));
+ }
+ return expectedWeather;
+ }
}
```
## Summary of changes:
| Step | Change |
|------|--------|
| **1** | Added `import java.util.function.LongFunction`; introduced `dayOffsetToWeather` lambda wrapping `scorer.lookupWeather()` in the original method body, replacing direct scorer calls |
| **2** | Extracted the weather-collection loop into a new `private List<Boolean> collectExpectedWeather(List<Instant>, LongFunction<Boolean>)` method |
| **3** | Removed `String quarter` parameter; added a **no-arg** `longRangeForecast()` that delegates to the parameterized overload wrapping the `scorer`; renamed the main method to accept `LongFunction<Boolean> dayOffsetToWeather` |