[#103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 — eregontp@...
Issue #17777 has been reported by Eregon (Benoit Daloze).
17 messages
2021/04/05
[#103305] [Ruby master Feature#17785] Allow named parameters to be keywords — marcandre-ruby-core@...
Issue #17785 has been reported by marcandre (Marc-Andre Lafortune).
21 messages
2021/04/08
[#103342] [Ruby master Feature#17790] Have a way to clear a String without resetting its capacity — jean.boussier@...
Issue #17790 has been reported by byroot (Jean Boussier).
14 messages
2021/04/09
[#103388] [ANN] Multi-factor Authentication of bugs.ruby-lang.org — SHIBATA Hiroshi <hsbt@...>
Hello,
5 messages
2021/04/12
[#103414] Re: [ANN] Multi-factor Authentication of bugs.ruby-lang.org
— Martin J. Dürst <duerst@...>
2021/04/13
SXMgdGhlcmUgYSB3YXkgdG8gdXNlIHRoaXMgbXVsdGktZmFjdG9yIGF1dGhlbnRpY2F0aW9uIGZv
[#103547] List of CI sites to check — Martin J. Dürst <duerst@...>
SGVsbG8gZXZlcnlib2R5LAoKRHVlIHRvIHZhcmlvdXMgcGVyc29uYWwgcmVhc29ucywgSSBoYXZl
4 messages
2021/04/22
[#103596] [Ruby master Feature#17830] Add Integer#previous and Integer#prev — rafasoaresms@...
Issue #17830 has been reported by rafasoares (Rafael Soares).
9 messages
2021/04/26
[ruby-core:103473] [Ruby master Feature#17749] Const source location without name
From:
mame@...
Date:
2021-04-16 06:21:06 UTC
List:
ruby-core #103473
Issue #17749 has been updated by mame (Yusuke Endoh). @tenderlove I'm not sure about the use case. What purpose do you want this for? Memory profiling? `const_source_location` and `source_location` are very similar but different for an anonymou class. The former returns the site where the class object is assigned to a constant, while the latter returns the site where it is created. But in almost all cases, they are same and redundant. I don't think it is a good idea to introduce similar and redundant fields in terms of maintenance, unless it is really needed. So, I'd like to ask a question: is the difference really needed for your use case? (I'm never negative for this proposal, but I wanted to confirm.) ---------------------------------------- Feature #17749: Const source location without name https://bugs.ruby-lang.org/issues/17749#change-91571 * Author: tenderlovemaking (Aaron Patterson) * Status: Open * Priority: Normal ---------------------------------------- Hi, I would like to be able to ask a class or module what its source location is without knowing the name. For example, I want to do this: ```ruby module A class B end end p A::B.const_source_location ``` In other works `A::B.const_source_location` would be equivalent to `A.const_source_location(:B)`. The reason I want to do this is because sometimes it is very difficult to get the name of a constant, and sometimes I don't have access to the constant that "encloses" the class or module. One example: ```ruby ObjectSpace.each_object(Class) do |k| p k.const_source_location end ``` In this case I have class objects, but I can't tell what constant `k` was defined *inside* of. Also I can't trust the "name" method on `k` because sometimes it's not the default method (of course I could work around that, but it's not fun). I've attached a patch that implements the feature, and there is a PR [here](https://github.com/ruby/ruby/pull/4324) Side note: I think I would like "source_location" better than `const_source_location`, but I wanted to just file a feature request so we could talk about the feature in general. ---Files-------------------------------- 0001-Add-constant-location-information-to-classes.patch (5.34 KB) 0001-Add-constant-location-information-to-classes.patch (5.97 KB) -- 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>