Issue #14889 has been updated by shevegen (Robert A. Heiler).


I don't have anything overly helpful to the discussion to add; but I wanted
to add one thing to this:

> We usually write an optional argument in a line: def print_summary(out = $stdout)

While I concur in general, I myself have experimented a little with layout 
such as:

    def foo(
       a = 'foo',
       b = 'bar',
    )

The reason was primarily because it is, for my bad eyesight, easier to assess which
arguments are used; I only have to look at the left hand side mostly. Makes it easier
for me to keep track what is going on.

This may be a rare layout perhaps, but coming from this, I understand where Samuel
is coming from (but this is not me saying anything pro or con on the suggestion
itself; I really only wanted to comment on spaced-out optional arguments).

On a side note that may not be very relevant either, one can add strings to ')'
such as:

    def foo(
        i = 'bar'
      )"hello world!"
      puts i
    end
    foo

:-)

I don't even know if that is a bug or a feature or something totally irrelevant.
I just found it funny and golfing-worthy (even though I am a horrible code golfer).
Almost a bit like python doc strings! :D

----------------------------------------
Bug #14889: TracePoint for :line never seems to trigger on argument list. Maybe by design?
https://bugs.ruby-lang.org/issues/14889#change-72751

* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
I have the following code.

```
  30  1|		def print_summary(
  31  0|			output = $stdout
  32   |		)
```

In the margin is the line number followed by the number of hits according to `:line` trace point.

I feel like line 31 should also trigger a line trace point. It's an argument, but it must be executed.

Maybe a different trace point? `:argument`?



-- 
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>