[#98621] Re: Function getlogin_r()'s protoype] — Bertram Scharpf <lists@...>
FYI,
3 messages
2020/06/02
[#98947] [Ruby master Feature#16986] Anonymous Struct literal — ko1@...
Issue #16986 has been reported by ko1 (Koichi Sasada).
66 messages
2020/06/26
[#98962] [Ruby master Bug#16988] Kernel.load loads file from current directory without '.' in path — misharinn@...
Issue #16988 has been reported by TheSmartnik (Nikita Misharin).
5 messages
2020/06/26
[#98969] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings — marcandre-ruby-core@...
Issue #16994 has been reported by marcandre (Marc-Andre Lafortune).
7 messages
2020/06/26
[#100117] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings
— matz@...
2020/09/25
Issue #16994 has been updated by matz (Yukihiro Matsumoto).
[ruby-core:98777] [Ruby master Bug#16959] Weakmap has specs and third-party usage despite being a private API
From:
headius@...
Date:
2020-06-13 00:46:20 UTC
List:
ruby-core #98777
Issue #16959 has been updated by headius (Charles Nutter). I think it's also worth pointing out that the gc.c comment I linked above does propagate to the official documentation, which states that users should go to Weakref for the public API: https://docs.ruby-lang.org/en/2.7.0/ObjectSpace/WeakMap.html We should avoid adding specs for APIs documented as non-public... and we should also avoid adding "private" APIs to Ruby without at least a "require" opt-in. ---------------------------------------- Bug #16959: Weakmap has specs and third-party usage despite being a private API https://bugs.ruby-lang.org/issues/16959#change-86134 * Author: headius (Charles Nutter) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- Weakmap is still described as an internal API, and the documentation points users at WeakRef as the official public API: https://github.com/ruby/ruby/blob/1fb16dbb6e28b9f32f92554d29e646e088b21a98/gc.c#L11928-L11936 However there are now specs for its current set of features, even though those features have never been discussed or approved as a public API: https://github.com/ruby/spec/tree/dd8437628a6f2de5b74b338d4960682bb1590a60/core/objectspace/weakmap And we are starting to see it being used by the community: * https://github.com/jruby/jruby/issues/6267 * https://github.com/rsim/oracle-enhanced/issues/2027 * https://github.com/rails/rails/pull/39121 One of two things needs to happen: * Weakmap is made a public API after some discussion. It would be an official public feature only in 2.8/3.0 or higher. * The specs are be removed and Weakmap remains a private API not to be used by the community. I suspect the addition of the specs led to folks starting to use this private API. Personally, I'm in much more in favor of making WeakRef support all the features necessary to implement Weakmap in pure Ruby, rather than the other way around: https://bugs.ruby-lang.org/issues/6309 But whatever happens it needs to happen soon, since this use case is now a merged feature in Rails master. -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>