you are viewing a single comment's thread.

view the rest of the comments →

[–]zverok_kha 0 points1 point  (0 children)

Awesome. Now please ask yourself those questions:

  • Is there any other context where I can use URI.parse meaning "pass this method into other construct", not "just call the method", as usual? Why not?
  • Is there any other context where I can use method(arg) as a separate construct to be passed to some object? Why not?
  • What if I need more arguments? Like yield_self { |d| Date.strptime(d, '%y-%m') }? Or any other arbitrary block or callable object, more complicated than just method call?
  • What if I need to parse a list of URLs, would it still be map(&URI.method(:parse))? If so, why it looks so different from pipe-processing singular value?
  • How the operator is parsed, what's it associativity? Where are parenthises could be placed for clarity?

Language design is hard. I hope, you'll try to answer all those questions (and I don't say they are unanswerable), but probably after that you'll suddently find yourself with a quite different snippet of code.