On 2017/05/27 18:49, eregontp / gmail.com wrote:
>> However, this proposal breaks this expectation.
> Could you explain it?
> 
> Is it because trace.enable { code } does not behave like
> begin; trace.enable; code; ensure; trace.disable; end ?

Yes.

> If so, I think this problem could be avoided by just changing the name to imply "thread-local",
> such as trace.enable_for_current_thread { code } or
> trace.enable_in_block { code }.

Yes.

This is what
> I try to consider to introduce how to filter the probes, like:

Considerations about introducing "thread-lcoal" enable:

(1) POSITIVE: because it may be common use case to enable.
(2) NEGATIVE:
  (2-1) because enable_xxx seems verbose.
  (2-2) because we will want to introduce similar method to
        limit file name or method name, like enable_file do ... end
        (this is why I proposed keyword arg)

-- 
// SASADA Koichi at atdot dot net

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>