ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: zverok.offline@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:90591] [Ruby trunk Misc#15428] Proc composition: what can quack like Proc?
Date: Mon, 17 Dec 2018 21:56:38 +0000 (UTC)	[thread overview]
Message-ID: <redmine.issue-15428.20181217215635.1f5338d5a3afd017@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15428.20181217215635@ruby-lang.org

Issue #15428 has been reported by zverok (Victor Shepelev).

----------------------------------------
Misc #15428: Proc composition: what can quack like Proc?
https://bugs.ruby-lang.org/issues/15428

* Author: zverok (Victor Shepelev)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
I believe, that solution of #6284 introduced important language inconsistency: as far as I can tell, it insists that **anything that responds to `#call`** is composable, e.g. **quacks like `Proc`**.

The problem is, previously it was **never** this way. `#call` method has a nice shortcut of `.()`, but when you wanted to tell something can quack like proc, it **always** was done by defining `#to_proc` method.

I understand it could be too late to ask, but I wonder why this inconsistency was introduced and is there a plan to take this step further? 
For me personally, this `#call`/`#to_proc` dichotomy was always weird and feels like it needs some unification (maybe anything having `#call` will automatically have `#to_proc` method?), but the situation when exactly one language feature treats it differently looks pretty weird for me.



-- 
https://bugs.ruby-lang.org/

       reply	other threads:[~2018-12-17 21:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15428.20181217215635@ruby-lang.org>
2018-12-17 21:56 ` zverok.offline [this message]
2018-12-17 22:00 ` [ruby-core:90592] [Ruby trunk Misc#15428] Proc composition: what can quack like Proc? zverok.offline
2018-12-18 22:33 ` [ruby-core:90611] " shevegen
2019-01-12  9:36 ` [ruby-core:91035] [Ruby trunk Bug#15428][Open] Refactor Proc#>> and #<< zverok.offline
2019-01-12 11:35 ` [ruby-core:91039] [Ruby trunk Bug#15428] " nobu
2019-01-12 12:08 ` [ruby-core:91041] " zverok.offline
2019-01-12 12:31 ` [ruby-core:91042] " nobu
2019-01-12 12:35 ` [ruby-core:91043] " nobu
2019-01-12 13:24 ` [ruby-core:91044] " zverok.offline
2019-01-13  7:08 ` [ruby-core:91058] " nobu
2019-01-20 20:04 ` [ruby-core:91195] " eregontp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.issue-15428.20181217215635.1f5338d5a3afd017@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).