Skip to content

Add circular buffer exercise #9

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

Merged
merged 1 commit into from
May 8, 2014
Merged

Add circular buffer exercise #9

merged 1 commit into from
May 8, 2014

Conversation

anthonygreen
Copy link
Contributor

Add metadata files for circular buffer exercise

@kytrinyx
Copy link
Member

kytrinyx commented May 8, 2014

Thank you ❤️

kytrinyx added a commit that referenced this pull request May 8, 2014
Add circular buffer exercise
@kytrinyx kytrinyx merged commit 8259aa5 into exercism:master May 8, 2014
@soniakeys
Copy link
Contributor

I have a question on consistency. The readme describes overwriting behavior for full buffers but existing Ruby and Javascript implementations throw exceptions. The WP article that this seems to have been drawn from mentions that either behavior might make sense depending on the context. Should the readme be reworded maybe? It could specify the exception behavior to keep language implemenations similar, it could be generalized like the WP article, or could even specify overwriting behavior--then the existing implementations would need to be changed.

@kytrinyx
Copy link
Member

kytrinyx commented Jul 4, 2014

I think it would make sense to make the README more general, mentioning both approaches (with a note that the test suite will choose one or the other, perhaps?).

@soniakeys
Copy link
Contributor

Oh wait, I see now the test scripts require both capabilities. Okay, we can do both. But yes, I think it would be good to mention both in the readme.

@anthonygreen
Copy link
Contributor Author

@soniakeys, @kytrinyx Please review pull request #11

petertseng added a commit that referenced this pull request Jan 15, 2017
* circular-buffer: Add canonical data

The circular-buffer exercise was first added in 2014 May at #9, with
Ruby and Javascript as the initial implementing tracks:

* exercism/DEPRECATED.javascript#17
* exercism/ruby#17

Implementing tracks:

* https://github.com/exercism/xcsharp/blob/master/exercises/circular-buffer/CircularBufferTest.cs
* https://github.com/exercism/xdlang/blob/master/exercises/circular-buffer/circular_buffer.d
* https://github.com/exercism/xecmascript/blob/master/exercises/circular-buffer/circular-buffer.spec.js
* https://github.com/exercism/xerlang/blob/master/exercises/circular-buffer/circular_buffer_tests.erl
* https://github.com/exercism/xfsharp/blob/master/exercises/circular-buffer/CircularBufferTest.fs
* https://github.com/exercism/xgo/blob/master/exercises/circular-buffer/circular_buffer_test.go
* https://github.com/exercism/xjavascript/blob/master/exercises/circular-buffer/circular-buffer.spec.js
* https://github.com/exercism/xlfe/blob/master/exercises/circular-buffer/test/circular-buffer-tests.lfe
* https://github.com/exercism/xlua/blob/master/exercises/circular-buffer/circular-buffer_spec.lua
* https://github.com/exercism/xpascal/blob/master/exercises/circular-buffer/uCircularBufferTests.pas
* https://github.com/exercism/xpython/blob/master/exercises/circular-buffer/circular_buffer_test.py
* https://github.com/exercism/xruby/blob/master/exercises/circular-buffer/circular_buffer_test.rb
* https://github.com/exercism/xrust/blob/master/exercises/circular-buffer/tests/circular-buffer.rs

All tracks pretty much implement the same tests, except:

* Tracks typically have the "read item just written" and "each item can
  only be read once" tests combined. These tests split the two.
* In dynamically-typed languages, buffers may be able to store
  heterogeneous types. This concept is not expressed in these tests.
* In some statically-typed languages, buffers use generics, such that
  buffers may store any one type of the client's choosing. This concept
  is also not expressed in these tests.
* The final test (ensuring that overwrite drops the right items) was more
  complex: capacity 5, 3 writes, 2 reads, write, read, 4 writes, 2
  overwrites, 5 reads. It's been simplified to capacity 3, 3 writes, 1
  read, write, overwrite, 3 reads.

Closes https://github.com/exercism/todo/issues/79
emcoding pushed a commit that referenced this pull request Nov 19, 2018
Update regex to look ahead and break starting consonant group on 'y'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants