Conversation
Modify example to demonstrate function application N times
WalkthroughThe changes update test cases by modifying expected outputs and function behavior. In the test helper files, expected results from clock-related computations in Stage 9 tests have been revised. In Stage 4 tests, the function previously named Changes
Sequence Diagram(s)sequenceDiagram
participant T as Test Runner
participant C as Clock Function
T->>C: Call clock()
C-->>T: Return timestamp
T->>T: Perform arithmetic (add/divide)
T-->>T: Print result
sequenceDiagram
participant T as Test Runner
participant A as applyTimesN
participant S as square
T->>A: Invoke applyTimesN(N, square, x)
loop N times
A->>S: Call square(x)
S-->>A: Return squared value
A->>A: Update x with new value
end
A-->>T: Return final result
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (5)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@ryan-gang the change makes sense, but the PR description doesn't mention why we're doing this - for the tester repositories, since they're public, I think it's worth spending some time making this clear (doesn't matter so much for core/frontend). Without access to Linear I wouldn't be able to tell that the reason we're doing this is to avoid introducing closures early |
closure from programs/stages before it is officially introduced
|
Thanks to @guy-732 for highlighting this! |
|
Thanks @guy-732 for highlighting the issue! |
Report: https://forum.codecrafters.io/t/wrong-tests-for-ey3/4156
Remove the closure in #EY3, with a higher order function example.