Repository navigation
Add a few stubs, and fix whitespace in many more - #1167
Merged
Merged
Conversation
depial
approved these changes
Oct 25, 2026
depial
left a comment
Contributor
There was a problem hiding this comment.
See separate comment on Base extensions.
Contributor
|
I think I'd be in favor of leaving the stubs blank which extend Do you have any feelings one way or the other? |
Contributor
Author
Contributor
Author
|
The no-stub comments in the solution file follow the #1166 precedent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wow, this one escalated. I noticed in #1166 that
rational-numberspreviously had no function stubs in the solution file. This PR adds stubs for three more exercises that lacked them.My uncertainty about this: the new stubs include
Base.{operator}in the function name. Do we prefer to leave outBase.here and use an import at the top of file, likerational-numbersdid in the previous PR? This is part of a wider discussion about how much we want the stubs to give away.Along the way, Claude spotted extensive non-compliance with your rule about a 4-space indent on the blank line in the function body. Plus a few missing newlines at EOF.
Adds function skeletons to three practice stubs, and indents the empty body line in every stub
There are no test or example changes in this PR. Every changed stub still parses in Julia.
Things to look at:
struct ComplexNumber <: Number. The supertype means≈works in the tests.Base:real,imag,+,-,*,/,abs,conjandexp.struct CustomSet, with a comment that the tests callCustomSet(elements)with a vector.Base:isempty,in,issubset,==,push!,intersect!/intersectandunion!/union.disjoint,complement!andcomplement.struct Pointand an emptymutable struct Robot.# define NORTH, EAST, SOUTH and WEST, so students choose how to represent headings. The stub doesn't give them an@enum.Robot(position::Tuple, heading),position,headingandmove!.turn_right!,turn_left!andadvance!are not stubbed. The canonical tests only reach them throughmove!.README.mdsays function skeletons "should include a blank new line with a four space indentation for the body", but most stubs left that line empty.function ...followed directly byend, so each now has a four-space body line.git diff -wshows the only changes other than whitespace: the three new skeletons and the four stubs that gained a body line.resistor-color.jlandspace-age.jlhad no newline at the end of the file. Now they do.