From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 36C3B20D09 for ; Sun, 4 Jun 2017 21:54:59 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 3E65C120788; Mon, 5 Jun 2017 06:54:38 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 9C440120787 for ; Mon, 5 Jun 2017 06:54:32 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=s8zS+dNWkWnF6BQD5Pb1ERni/Lc=; b=orD2bGzKtzTuew6p0o yFmq0g10kgvKDB3MPxogR1RSu0079ziMsVheZqIC4fL0P4RvMc2xTGhdjk5oAs3N w/YULKTO8FmcPWFr15zuGtGjb8izb+i1eQTm8cNKcbjGGlaZcTeIbtV1941+3zL5 B5e4WHVgZKrEjP+HeuJlHdaqM= Received: by filter1133p1mdw1.sendgrid.net with SMTP id filter1133p1mdw1-31615-59348195-1A 2017-06-04 21:54:29.447692967 +0000 UTC Received: from herokuapp.com (ec2-54-227-90-141.compute-1.amazonaws.com [54.227.90.141]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id krDmu3_zTTOcBq-6H0G-yQ for ; Sun, 04 Jun 2017 21:54:29.402 +0000 (UTC) Date: Sun, 04 Jun 2017 21:54:27 +0000 From: rob@flowof.info To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56601 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 12739 X-Redmine-Issue-Author: znz X-Redmine-Sender: robertgleeson 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7U8rIhDuOFxHp29T5UHEfLN7U4UvaLbzDRXZ VOolCEc7Rh0kFXa3xfps0385chHC1nuMP8rn3Q9ty2sA3eGJjiUT2MhcUSlXIvIrx4LLfU/kxYkR3v oHA6HPgP/p6+1Uc20jql6cFhApo5XF1GTRgk X-ML-Name: ruby-core X-Mail-Count: 81571 Subject: [ruby-core:81571] [Ruby trunk Feature#12739] deprecate_constant :Fixnum, :Bignum 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 #12739 has been updated by robertgleeson (Robert Gleeson). robertgleeson (Robert Gleeson) wrote: > znz (Kazuhiro NISHIYAMA) wrote: > > How about `class Object; deprecate_constant :Fixnum, :Bignum; end`? > > > > * naruse supports: https://twitter.com/nalsh/status/773800491671101441 > > * akr objects: https://twitter.com/tanaka_akr/status/773817391218249729 > > > > I don't mind either way. > > Do you have any comment about it? > > It would be nice to have `constant_deprecated?`. > To avoid all of these warnings while supporting <2.4 and >=2.4 i track what constants are deprecated in an array, and > then avoid using them or not by checking the array at runtime. It's bit of a pain.. I realise my comment isn't clear, here's very simple code to show what i mean: deprecated_constants = [:Fixnum, :TimeoutError, :Bignum, :FALSE, :TRUE, :NIL] Object.constants.each do |constant| const_get(constant) unless deprecated_constants.include?(constant) end the real code i have is more complex, but in essence this is the problem, and deprecated_constants has to be maintained by me manually, which will become out of date over time. ---------------------------------------- Feature #12739: deprecate_constant :Fixnum, :Bignum https://bugs.ruby-lang.org/issues/12739#change-65273 * Author: znz (Kazuhiro NISHIYAMA) * Status: Closed * Priority: Normal * Assignee: * Target version: ---------------------------------------- How about `class Object; deprecate_constant :Fixnum, :Bignum; end`? * naruse supports: https://twitter.com/nalsh/status/773800491671101441 * akr objects: https://twitter.com/tanaka_akr/status/773817391218249729 I don't mind either way. Do you have any comment about it? -- https://bugs.ruby-lang.org/