-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add exercise Circular Buffer #664
Conversation
41f22f4
to
2528321
Compare
Get it out there and see what falls from the sky‽ |
I had a thought just now. What if, instead of buffer::overwrite bufname value we had buffer::write -f bufname value That would get the student to do option handling inside the function. That's a more shell-like syntax, but adds complexity. Worth it? |
Is this the exercise we want to introduce additional complexity in? It is already admittedly somewhat difficult. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR contents look good to me. The idea behind it...
I'm a bit iffy here based on the complexity. Just because you can get bash to do this doesn't mean it's reasonable to do so. I'm leaning more towards passing on exercises that don't fit the language vs jumping through hoops to get things working.
# To use `getopts` in a function, these vars must be local. | ||
local OPTIND OPTARG | ||
while getopts :f opt; do | ||
case $opt in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case $opt in | |
case "$opt" in |
That is completely reasonable. I'm content to close this. I'll create an issue so we can discuss foregoing exercises. |
Although this is do-able in bash, it doesn't mean that it's smart to do it. |
I had a thought about how to implement this. It's a library like the list-ops exercise.
I'm curious what you all think.
Because it's a library, the tests don't use the bats
run
command, soassert_success
andassert_failure
don't apply. You'll see test assertions look like thisI didn't write any additional instructions. It's a fairly difficult exercise, so users are on their own.