I turned the PR ready to review: https://github.com/ruby/ruby/pull/17353 If the requirement written in the current description (and the reconfirmation in #note-6) is just enough, I believe it can go forwardhasumikin (hitoshi hasumi)
#note-7 I do not oppose `bit_put` itself, but my future plan includes introducing a range parameter like: ```ruby data.bit_set(3..19) ``` In the above, you can assume that the `data` is a header managing some resource or a serial ...hasumikin (hitoshi hasumi)
Thank you, Matz. Based on your decisions in #note-5, I've updated the Description to serve as the finalized specification. Summary: - Renamed `bit_at` to `bit_get`, returning `1 | 0 | nil`. - Added the method `bit_set?`, returning `t...hasumikin (hitoshi hasumi)
Memorandom. I had a face-to-face conversation with Matz and Shugo yesterday. > Matz: each_bit should yield `0/1`, not `false/true` > ... (Matz didn't reject it at least) If it is realized, Pretty-Print could make something like t...hasumikin (hitoshi hasumi)
* [Feature #22118] Introduce Basic Bit Operations into String (hasumikin) * Are these methods suitable as the first subset? * Is the `lsb_first:` keyword acceptable?hasumikin (hitoshi hasumi)
This PR implements basic bit operations into String, incorporating revisions made following the discussion (esp. #note-5) PR URL: https://github.com/ruby/ruby/pull/17353 ## Single-bit read and mutation * `String#bit_get(offset, ...hasumikin (hitoshi hasumi)
matz (Yukihiro Matsumoto) wrote in #note-13: > Could you propose a minimal v1 subset along these lines? The keyword design (`lsb_first` vs `msb_first`, raised by byroot and Eregon) can be settled as part of that. Thank you for the ac...hasumikin (hitoshi hasumi)
Eregon (Benoit Daloze) wrote in #note-8: > This seems like a lot of methods to add to String, which I think already has (too) many methods. > ... Thank you for the feedback. My starting point is that binary data in Ruby is already r...hasumikin (hitoshi hasumi)
kou (Kouhei Sutou) wrote in #note-3: > +1 Could you update the description? I updated it with `<del>...</del>` ---- byroot (Jean Boussier) wrote in #note-4: > ... Thank you. That'd be one of the next points if Matz approved th...hasumikin (hitoshi hasumi)
* [Feature #22082] Introduce Bit Operations into String (hasumikin) * I'd like you to discuss whether it's appropriate to add such functionality to the String class * I've proposed many methods in this ticket, but I don't think we ne...hasumikin (hitoshi hasumi)