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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 0808B1F4CC for ; Thu, 19 Dec 2024 00:42:00 +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=V2dDzPe1; 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=UDWroodJ; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734568888; bh=w0zZyuSdTcSlj2CwMwoHMQCv7e0EAEdo/hdAdLbzld4=; 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=V2dDzPe1ISB3HMQ90VOBedKc12LEifPbTGQ1cex8flPEN663SaWR//f+NBgL+UIsN lYX140FMlf0tFbvJbUMEN7DJiY3JrrnCYzPRhcKo7K0ghEwc4ia7X3A3ko3SFiTuoi 3Rc9jhHXDa6FjgT4QoJLvpp9V87aj/SXC7pVF8oU= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 18AE445304 for ; Thu, 19 Dec 2024 00:41:28 +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=UDWroodJ; dkim-atps=neutral Received: from s.wfbtzhsw.outbound-mail.sendgrid.net (s.wfbtzhsw.outbound-mail.sendgrid.net [159.183.224.105]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 9C46C44E08 for ; Thu, 19 Dec 2024 00:41:24 +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=EZSgPNJ6RSyRBVzCI5laSx2vdpCG+Bk7WfEQpWMfYtc=; b=UDWroodJ24pixndElrt4tlRYz99QAWGiQOnRcvm8saNSyJrcTYPHfnWzihF9pPRKNhA8 lW158yhXjIwc7pZvtbUgkEX38kAaAedEZxLRjDAzUBJ56c8RR7Qe16DpN8QRXXzkVtpH6D EAQG9JnUMrhCIcFV1omhBkpXGTY87aug/c2DQCXyNkM7aluuf2wxm+r2jWCCsUV1bqgrmc p+0e+QTatvy8XlO0rl2grAht7R0f3W3L3f4xU0Xr12Ebu1TnShUuAk6MK9A7QxN50upyvz cIgfb2tcc16cKjhMfbt596x8kQb4556J2PCaVDW2rEhYvQDUm4TD8tpFIa1ZK55A== Received: by recvd-786d47b7ff-rh8k5 with SMTP id recvd-786d47b7ff-rh8k5-1-67636BB3-18 2024-12-19 00:41:23.598286227 +0000 UTC m=+2949470.437629011 Received: from herokuapp.com (unknown) by geopod-ismtpd-32 (SG) with ESMTP id 8JlvUcbuT8K1A358IlyvhA for ; Thu, 19 Dec 2024 00:41:23.570 +0000 (UTC) Date: Thu, 19 Dec 2024 00:41:23 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20965 X-Redmine-Issue-Author: zverok X-Redmine-Issue-Priority: Normal X-Redmine-Sender: shan 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: 96985 X-SG-EID: =?us-ascii?Q?u001=2E9fGRHcaur0AuvitC=2F1zdJ7W0yF4MIWkxScnW56JP3D1Ru6E8cp4fwU50h?= =?us-ascii?Q?hG=2FIY2Xn1m8ku39wNL1Ycq7qVKPg2at8MlH86pC?= =?us-ascii?Q?QD+axk8pzTX+v3pQL=2FLa81M1NDe1nz8sGx9iaG9?= =?us-ascii?Q?oR3rTpvSTiEISPlcpTeBPntdzwUCasahBIiIlRm?= =?us-ascii?Q?IkwZIXsH+m0svCvVRDor7OhQZp3zf0Ap+h8ZXdq?= =?us-ascii?Q?VzkTtfgVmh16gDOaQhl+8AVcsvfhj9X6AsjpImP?= =?us-ascii?Q?0AXNOcAz5E56xLQXX+QuJg1QAA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: Q6VMFKBM7R5JEJMWMDF5LZ752XSQSVGR X-Message-ID-Hash: Q6VMFKBM7R5JEJMWMDF5LZ752XSQSVGR 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:120308] [Ruby master Bug#20965] `it` vs `binding.local_variables` List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "shan (Shannon Skipper) via ruby-core" Cc: "shan (Shannon Skipper)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20965 has been updated by shan (Shannon Skipper). It does seem like that last one should be `[:it]` for consistency if it wasn't intentional. +1 An aside, but it's also interesting that using `_2` causes `_1` to also be defined under Binding#local_variables. ``` ruby proc { _9; local_variables }.call # => [:_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9] proc { it; local_variables }.call # => [] ``` ---------------------------------------- Bug #20965: `it` vs `binding.local_variables` https://bugs.ruby-lang.org/issues/20965#change-111074 * Author: zverok (Victor Shepelev) * Status: Open * ruby -v: ruby 3.4.0dev (2024-12-15T13:36:38Z master 366fd9642f) +PRISM [x86_64-linux] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- `it` is not available in the list of `binding.local_varaibles`, **unlike** numbered parameters: ```ruby p(proc { binding.local_variables }.call) # [] p(proc { |x| binding.local_variables }.call) # [:x] p(proc { _1; binding.local_variables }.call) # [:_1] p(proc { vars = binding.local_variables; _1; vars }.call) # [:_1, :vars] p(proc { it; binding.local_variables }.call) # [] ``` I wonder if it is deliberate or accidental. -- 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/