From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id A7C1719E003D for ; Tue, 29 Dec 2015 03:14:01 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 5C14DB5D8D8 for ; Tue, 29 Dec 2015 03:46:38 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 4670118CC7B1 for ; Tue, 29 Dec 2015 03:46:38 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 127B61204E8; Tue, 29 Dec 2015 03:46:37 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id AC981120468 for ; Tue, 29 Dec 2015 03:46:32 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=mTiGWju4hOWQsfJHcvRFCTnV+vc=; b=JByDC4ZOeXKX92NQVZ t7GVYPEAEXk/YJ1UO3oC/Xtx74Ubu1ez/fMRxXGyiL6LrW5z9otePvKK5dediwuB LqOWu/PL9kgE715xxHsoN5RdzqPl9RFiYtFlYzgrrxR49Cl4taXJ+HqICW43V8ag bZ0sJdDf9BayDKEPWinEqRCnE= Received: by filter0607p1mdw1.sendgrid.net with SMTP id filter0607p1mdw1.21777.568183802D 2015-12-28 18:46:24.704488167 +0000 UTC Received: from herokuapp.com (ec2-54-226-221-30.compute-1.amazonaws.com [54.226.221.30]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id xd2GiXrYS_OLeaxGx60vwg for ; Mon, 28 Dec 2015 18:46:24.568 +0000 (UTC) Date: Mon, 28 Dec 2015 18:46:24 +0000 From: ruby-core@marc-andre.ca To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 47164 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11878 X-Redmine-Issue-Author: sawa X-Redmine-Issue-Assignee: nobu X-Redmine-Sender: marcandre X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6ifJSCeWIa5htjHFqWi6upp0456fUfnLPQVr LowgO0ai567jq5Q7YVcix5WWQg17JMTFfAn85nlBgjiSZ9+MkE+H24/TgNqQ0OvxAHAJU98aGcN9j9 /qQfaHPKNne4tFUpMbKkUvNDqObziGVq8Qb/UAV1j4OuOyziiGExSbVjdw== X-ML-Name: ruby-core X-Mail-Count: 72564 Subject: [ruby-core:72564] [Ruby trunk - Bug #11878] Comparison of prepended modules X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11878 has been updated by Marc-Andre Lafortune. Assignee set to Nobuyoshi Nakada Indeed. ---------------------------------------- Bug #11878: Comparison of prepended modules https://bugs.ruby-lang.org/issues/11878#change-55821 * Author: Tsuyoshi Sawada * Status: Open * Priority: Normal * Assignee: Nobuyoshi Nakada * ruby -v: 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Including module `B` to class/module `A` gives the following results (as expected): ~~~ module A; end module B; end A.include B A < B # => true B < A # => false A <=> B # => -1 ~~~ And prepending module `C` to `A` gives the following results: ~~~ module C; end A.prepend C A < C # => true C < A # => nil A <=> C # => -1 ~~~ It looks like including and prepending almost do not make difference with respect to module comparison, i.e., `A < B` and `A < C` are the same, and `A <=> B` and `A <=> C` are the same. However, then, the difference between `B < A` and `C < A` stands out unexplained. I suppose this is a bug. If `C < A` were to return `false`, then it would be at least consistent. However, if that was what was intended, then at least to me, it is strange. In that case, I would like to make this a feature request. I would rather expect: ~~~ A < C # => false C < A # => true A <=> C # => 1 ~~~ -- https://bugs.ruby-lang.org/