Repository navigation
README: the ndarray axis keyword, and what makes $/ a different setter - #888
Merged
Merged
Conversation
… setter (#886) Two sentences had fallen behind the code they describe. **NDArray.** The line read "(axis, keepdims: true)", so the only documented way to reduce along an axis was the positional one. #883 taught the reductions and cumsum NumPy's `axis:` spelling, and cumsum was not in the sentence at all. Verified against rbgo built at 6eb7e4a: a.sum => 15.0 a.sum(axis: 0).to_a => [3.0, 5.0, 7.0] a.sum(0).to_a => [3.0, 5.0, 7.0] a.cumsum(axis: 1).to_a => [0.0, 1.0, 3.0, 3.0, 7.0, 12.0] a.argmax(axis: 1).to_a => [2.0, 2.0] a.sum(0, axis: 0) => ArgumentError: axis given both positionally and as a keyword **Predefined globals.** The list claims each global gets "the setter MRI's variable table gives it rather than one untyped slot", then groups `$;`, `$,` and `$/` as though one setter covered them. Init_IO wires `$,` and `$\` to rb_str_setter and `$/`/`$-0` to deprecated_rs_setter, and #886 made that split real: `$/` now stores a frozen plain String of the bytes it was given instead of the object itself. The README now says so, because that difference is exactly the claim the sentence makes. rubydiff against MRI 4.0.7, same program, five lines of output: AGREE exit 0 A rbgo-main ruby 4.0.9 [arm64-darwin] B ruby@4.0 ruby 4.0.7 (2026-09-15 revision 229531a6cf) +PRISM The same program under the system ruby 2.6.10 diverges on exactly the two `$/` lines and agrees on the two `$,`/`$\` lines, which is the control: the freezing is 4.0 behaviour, not something rbgo invented. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Two README sentences had fallen behind the code they describe. Both claims
below come from running the real interpreter, not from reading the binding.
NDArray — the axis keyword (#883)
The line read
(axis, keepdims: true), so the positional form was the onlydocumented way to reduce along an axis, and
cumsumwas absent from thesentence. rbgo built at
6eb7e4ad:Predefined globals —
$/is not$,(#886)The list claims each global gets "the setter MRI's variable table gives it
rather than one untyped slot", and then groups
$;,$,and$/as thoughone setter covered them.
Init_IOwires$,and$\torb_str_setterand$//$-0todeprecated_rs_setter; #886 made that split real, and$/nowstores a frozen plain String of the bytes it was handed rather than the object.
That difference is precisely what the sentence promises, so it is now spelled
out.
rubydiffon a program exercising all four, against MRI 4.0.7:The control: the same program under the system
ruby 2.6.10diverges onexactly the two
$/lines and agrees on the two$,/$\lines. The freezingis 4.0 behaviour that rbgo now matches, not something rbgo invented — a run
that agreed with 4.0.7 and with 2.6.10 alike would have proved nothing.
🤖 Generated with Claude Code