From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 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 C91541F4B8 for ; Thu, 10 Oct 2024 11:22:04 +0000 (UTC) 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=w5jcRD7j; 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=YzI2RIh/; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1728559322; bh=wPXIRYAwCJZZwbpvEuZxdMOZHbVgiSETBXI2Wza6KP4=; 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=w5jcRD7jNdCyzcLiLkW4DDQMBsRSy0eMjx6S1TuAIT84fW0W8rbMP2Pkg0XlHr4SV 9xRW5O80rWE9SutPWwx45Mwa8YN0i1tQoO+WrNuaegzK6y08hnascm3V0pB+I7GSVF CfJpI/6rWKWwkUn2x1QHIJHPkcAldwgXIm7uli+4= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id A493E43FE8 for ; Thu, 10 Oct 2024 11:22:02 +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=YzI2RIh/; dkim-atps=neutral Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id A7B9743DE0 for ; Thu, 10 Oct 2024 11:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=ky9m4znQe9COU7R+/AqfKEl5SRg1nosXOYluDqxOQ8c=; b=YzI2RIh/YEsibMpUWwXwagiav8yj/Nw/YThvYiPLzSp2AELsSp1RKElqXV1FWPGx91Qu sV3Dpk3bc0hs/tChN/JMIF2bJz1xg7Ss9WBC+7og7duvnvyeL/hXbplh8yB3hfz6APHixc hkwjOc+pLtZC9M7zG7i2cr/zCQcLKzBWOa81vs3dnwamTw39z46oS+AaAk0fmYOtqankLI jyUcQAjuXRmwk2+WYb9LkytYrXxILRItrdMyYMvsArl/DzhWvHM5UnRbg06XkEskazEcab IfCQoL/M/6fvevTDMJrrMyu7OmnsFpL9SsKrIE40uSeos6WSKGfb6s8DCC2WR9nw== Received: by recvd-55fc7fd858-k2xfm with SMTP id recvd-55fc7fd858-k2xfm-1-6707B8CF-2 2024-10-10 11:21:51.070555235 +0000 UTC m=+2395542.734389439 Received: from herokuapp.com (unknown) by geopod-ismtpd-2 (SG) with ESMTP id 1Px2FaVYTWObpkXAwbhzWw for ; Thu, 10 Oct 2024 11:21:50.985 +0000 (UTC) Date: Thu, 10 Oct 2024 11:21:51 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 20793 X-Redmine-Issue-Author: artemb X-Redmine-Issue-Priority: Normal X-Redmine-Sender: artemb 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: 96140 X-SG-EID: =?us-ascii?Q?u001=2EHnvJnzJ2lmG+PgbkniTdgZfnvZUxDZtmfCdpK9x5f=2FhMt3rLfcsnBVG2E?= =?us-ascii?Q?=2FOsr2hsb6M8cYOQvfYebBgPNyJD=2FOB967Vr57W=2F?= =?us-ascii?Q?hJfOBhQ9fpOOucIU63it318uJ4S2tjkbyQVdFxg?= =?us-ascii?Q?A0uSlQIyjnqsxwpBTJlCXKDCjYPYWHYmItXJhV3?= =?us-ascii?Q?jGfscLS8bPTfjuQzU6Obiyhd8qZoB4xn1lSUdW6?= =?us-ascii?Q?s0UMDlOIzbM4v4u1wrX4POJ7F3gCZV9KyOJIViN?= =?us-ascii?Q?vaEHKFvZCKfzMrpfYhzi0MOKzA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 3JHIFHBGENV2WOFTD5BPXKVAFRE5XMNJ X-Message-ID-Hash: 3JHIFHBGENV2WOFTD5BPXKVAFRE5XMNJ X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:119505] [Ruby master Feature#20793] Allow Multiple Arguments for the .is_a? Method List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "artemb (Artem Borodkin) via ruby-core" Cc: "artemb (Artem Borodkin)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20793 has been updated by artemb (Artem Borodkin). Eregon (Benoit Daloze) wrote in #note-2: > I think pattern matching should be used here instead Very nice, thank you! If kind_of? (and alias is_a?) has a strong implementation optimization, I agree that this is not so important enhancement. ---------------------------------------- Feature #20793: Allow Multiple Arguments for the .is_a? Method https://bugs.ruby-lang.org/issues/20793#change-110120 * Author: artemb (Artem Borodkin) * Status: Open ---------------------------------------- I propose allowing multiple arguments to be passed to the .is_a? Method imply "OR" semantics: ``` ruby name.is_a? String, Symbol ``` Currently, we need to write the following to achieve the same functionality: ``` ruby [String, Symbol].include?(name.class) ``` -- 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/