[#116016] [Ruby master Bug#20150] Memory leak in grapheme clusters — "peterzhu2118 (Peter Zhu) via ruby-core" <ruby-core@...>
Issue #20150 has been reported by peterzhu2118 (Peter Zhu).
7 messages
2024/01/04
[#116382] [Ruby master Feature#20205] Enable `frozen_string_literal` by default — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Issue #20205 has been reported by byroot (Jean Boussier).
77 messages
2024/01/23
[ruby-core:116152] [Ruby master Feature#20176] Array#pack: support offset kwarg
From:
"chucke (Tiago Cardoso) via ruby-core" <ruby-core@...>
Date:
2024-01-10 12:46:19 UTC
List:
ruby-core #116152
Issue #20176 has been reported by chucke (Tiago Cardoso).
----------------------------------------
Feature #20176: Array#pack: support offset kwarg
https://bugs.ruby-lang.org/issues/20176
* Author: chucke (Tiago Cardoso)
* Status: Open
* Priority: Normal
----------------------------------------
I was changing some code to use ruby 3.3's new `buffer` kwarg (great addition btw!) when using `Array#pack`. There are a few cases however, where I could perform the change, as not all my usages rely on appending; in some, I'm actually prepending it.
To solve this, I'd like to propose the `offset` kwarg, which declares where to add the resulting string. picking up on example from the docs:
[65, 66].pack('C*', buffer: 'foo') # => "fooAB"
[65, 66].pack('C*', buffer: 'foo', offset: 0) # => "ABfoo"
[65, 66].pack('C*', buffer: 'foo', offset: 1) # => "fABoo"
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/