From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on starla X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=DxFEIs32; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=i/hMRtb1; dkim-atps=neutral Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D20741F6CC for ; Tue, 16 Sep 2025 11:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1758023523; bh=Eoh3ybmUZuwx2kCoo1iGqF7J4quw4dSlGoCWpjeoAag=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=DxFEIs32Wf80Hh8vqkOxpNy7hWu8PwA8/y0thpsNIp/x38UaqlPq8eSkCPFVPterm 1/L9fvO05pF6qxMvQ6NE+t1h4bMQwe71Ze9pe9WkMNtlcTpRVHbl5viEPJF/tS/mWo zTXIvv6dlRH9Z5TYgEHqobUqy2+65kw7/L8yB79s= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 3CE5848ED3 for ; Tue, 16 Sep 2025 11:52:03 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=i/hMRtb1; dkim-atps=neutral Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 75F2142D6D for ; Tue, 16 Sep 2025 11:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=date:from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:date:from:subject:to; s=s1; bh=usnwUJ3hbHS/RLQ2tqoABlbHAMBRh9ORCaxBhH4dYJA=; b=i/hMRtb1m0ahTfOr9JL9aAf+qJgH0jjRhIPbAStU6Cf0aD4ZV3dwZ+3xO2UEV/N44Cq3 xJhpghocWw0gdItCgZLnxePq1cBDvHAaFijzHhXszS19oBoDF1NaENBufV7FMCiIVAMtD4 Ubw3YtfKJHgUko68wufuNXv6G3PDsuaoiPnxGjYSgL/2BzCUFBba7gIE4QV4l42f08Dje1 AY6bUmMcdN0idnU96lbSZjzRI7jBHJM6O4cEMePhgi9p4X/qxZoK4jP4GX85bNCqCxQ/4a yqbBwLlaDrnYWXQTTjN/aj0QE+L79hi6MqC/+1/LP2vjtwG0Bk3Ahvt+xl68qdHQ== Received: by recvd-canary-75b76f449d-zv89v with SMTP id recvd-canary-75b76f449d-zv89v-1-68C94F20-9 2025-09-16 11:50:56.229352271 +0000 UTC m=+9031355.841516735 Received: from herokuapp.com (unknown) by geopod-ismtpd-8 (SG) with ESMTP id B8AxyYjyRLiuTPTTOQStSQ for ; Tue, 16 Sep 2025 11:50:56.205 +0000 (UTC) Date: Tue, 16 Sep 2025 11:50:56 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 21555 X-Redmine-Issue-Author: shan X-Redmine-Issue-Priority: Normal X-Redmine-Sender: Dan0042 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-Redmine-MailingListIntegration-Message-Ids: 100089 X-SG-EID: =?us-ascii?Q?u001=2EHy4LB1bizMxDg=2Fk6r7dYDS9qUDe3jZN8DIPm4OS+F86l7XdLFEAVX=2F2lh?= =?us-ascii?Q?z0Jj=2Ft7J6DgKnq5Qaf6Ba4+egck=2FoKuUHMa9Cn6?= =?us-ascii?Q?7D+EQ8vUJVu1VQUJD35gLdGLePs23SxhcKvvijZ?= =?us-ascii?Q?SyH3Xu2IOPKJFNBSAmmRBRGCFdnfgOB0FLeyJhX?= =?us-ascii?Q?zH0gnbybi1PPWOZrbtg2F2Lmft5ncKXdMzerUx3?= =?us-ascii?Q?DKCMc5XBl0XsSH5REDNEgPWlKeZepVxi0Ulb3Q=2F?= =?us-ascii?Q?o+t4FBb4BpdrjAzxN4eSbi0gyg=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 7ZK4GZ4VE6UGH77ZQWCH5Q44YWVQM2SW X-Message-ID-Hash: 7ZK4GZ4VE6UGH77ZQWCH5Q44YWVQM2SW X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:123260] [Ruby Feature#21555] Add support for predicate attribute reader names List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Dan0042 (Daniel DeLorme) via ruby-core" Cc: "Dan0042 (Daniel DeLorme)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21555 has been updated by Dan0042 (Daniel DeLorme). I think Matz's position is clear and will not change, so what about closing the related tickets that are still open? ---------------------------------------- Feature #21555: Add support for predicate attribute reader names https://bugs.ruby-lang.org/issues/21555#change-114626 * Author: shan (Shannon Skipper) * Status: Rejected ---------------------------------------- After manually aliasing predicate methods many times, I wanted to propose letting `attr_reader` take predicate method names that correspond to instance variables of the base name without a trailing question mark. https://github.com/ruby/ruby/pull/14391 If the base name method doesn't already exist, a predicate name defines a base name method attribute reader to alias then undefines the base name. For example, this creates an `enabled?` method that reads `@enabled`: ```ruby attr_reader :enabled? ``` This feature is only supported for `attr_reader` and `attr`, not `attr_writer` or `attr_accessor`, since setter methods cannot have question marks. Example: ```ruby class Example attr_reader :valid?, :meaning def initialize @valid = [true, false].sample @meaning = 42 end end Example.new.valid? #=> true ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/