[#80974] [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit — ko1@...
Issue #13517 has been updated by ko1 (Koichi Sasada).
4 messages
2017/05/02
[#81024] Re: [Ruby trunk Feature#13517] [PATCH] reduce rb_mutex_t size from 160 to 80 bytes on 64-bit
— SASADA Koichi <ko1@...>
2017/05/07
sorry for late response.
[#80996] [Ruby trunk Feature#13544] Allow loading an ISeqs sequence directly from a C extension without requiring buffer is in an RVALUE — sam.saffron@...
Issue #13544 has been reported by sam.saffron (Sam Saffron).
3 messages
2017/05/04
[#81016] [Ruby trunk Bug#13526] Segmentation fault at 0x0055c2e58e8920 ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] — s.wanabe@...
Issue #13526 has been updated by wanabe (_ wanabe).
3 messages
2017/05/07
[#81048] Re: [ruby-cvs:65788] normal:r58614 (trunk): rb_execution_context_t: move stack, stack_size and cfp from rb_thread_t — SASADA Koichi <ko1@...>
It causes compile error on raspi 3.
3 messages
2017/05/09
[#81201] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle — "U.NAKAMURA" <usa@...>
Hi, Eric
4 messages
2017/05/16
[#81202] Re: [ruby-cvs:65935] normal:r58761 (trunk): test/test_extilibs.rb: do not check the existence of fiddle
— Eric Wong <normalperson@...>
2017/05/16
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#81427] Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534) — SASADA Koichi <ko1@...>
Hi,
6 messages
2017/05/28
[#81428] Re: Fwd: [ruby-changes:46809] normal:r58924 (trunk): test for IO.copy_stream CPU usage (r58534)
— Eric Wong <normalperson@...>
2017/05/28
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:81420] [Ruby trunk Feature#13560] Module#attr_ methods return reasonable values
From:
dunrix29a@...
Date:
2017-05-27 15:29:09 UTC
List:
ruby-core #81420
Issue #13560 has been updated by dunrix (Damon Unrix). > What would perhaps be nice would be to have a way to initialize these to nil, upon attr_* definition Why nice ? This is definitely a purpose of `initialize` method. Belongs to object initialization, not class definition. In addition, there is no general rule for nil as a default value. > do not know whether it makes anything more prone to errors. If you rename an attribute, you shouldn't forget change an argument name passed to visibility method call. Suggested feature allows single point of change. ---------------------------------------- Feature #13560: Module#attr_ methods return reasonable values https://bugs.ruby-lang.org/issues/13560#change-65131 * Author: dunrix (Damon Unrix) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Hi, I'm suggesting all `Module#attr_` [methods](http://ruby-doc.org/core-2.4.1/Module.html#method-i-attr_accessor) should return array of generated method names, instead of useless `nil`. Make them more concise across `Module` API, corresponding to logic of [`Module#define_method`](http://ruby-doc.org/core-2.4.1/Module.html#method-i-define_method), allow pass as arguments to visibility `public/protected/private` methods etc. Concerned method names: * attr_accessor * attr_reader * attr_writer Demonstration example: ``` class LookBeforeYouLeap api_meths = attr_accessor :ruby_api # api_meths == [:ruby_api, :ruby_api=] private *api_meths # Or you can pass generated methods directly # protected *attr_reader(:ruby_papi, :ruby_cext) end # Assignment to temporary local variable `api_meths` does not pollute class'es # namespace. ``` I'm aware *attr_** methods also create corresponding instance variables, but `Module` API has no use for them, unlike created accessor methods. In current state, where *attr_** methods return `nil`, it makes class definition more prone to errors, especially at code refactoring: ``` class ExistingWay attr_accessor :ruby_api # result is nil # Need write method names manually private :ruby_api, :rby_api= # throws NameError exception when executed # Any change of generated accessor methods names require manual rewrite # at each visibility method call also. end ``` -- 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>