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 5E6671F4CC for ; Mon, 23 Dec 2024 08:52:10 +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=LWByYd6w; 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=k5hX5Pei; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734943927; bh=UJlcwrAZlg0erFwB/U1Bf2w54iqEnKw6cM5oNjSnrhQ=; 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=LWByYd6w4OWmKQ/bnb2xrxuFUQwoye7PmkqG7Iwj8wfz4YZWVHgin1Zh5Wf71RWfl J0XIG6yqrw7kbjRb7LeRiBigpruTFAFwvCjvHOew62IksZIhPy6OCbZmpuGdjq4JPf rZ1/LgFdPrmEETLbPgjflTrc+V49TUXc0vDNnYJY= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id CF79245F44 for ; Mon, 23 Dec 2024 08:52:07 +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=k5hX5Pei; 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 06C9045F2D for ; Mon, 23 Dec 2024 08:52:03 +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=wDyi5LpqH1jtSX9SmbgyVBmsPvPxi4msuE3eK5cVhdE=; b=k5hX5PeixaLnH7zxsEEHDrygHdoTkOsxPEPSa0f+197t/oHL93XlYTlyFenFCsSNd0mB tfgZM453u8IBNpL+yjmllJxh6wAxr95BuGn8vVojlO93jywYfi1ZeYzxsF0Wn29DuNhMmO szaIxoww4algt4RxAzqw+IUcxru1NrCi7y+XZObq3mg+8BYaauiocWSfo0S4QVT8UFuLsJ ls0JGvCq731x4CcZLCpDlxRvmhYOuAJHG+ri3K86GcXder4Z4MeCAWZvFpITZiqrzOejXq v6Vr4TP5qLB2bTS+kvFJB2nJ0W0tag8l0Q2rZZYArKBa1rRkVdMGYiuQyY8ODBHw== Received: by recvd-5f54b5d587-djvzq with SMTP id recvd-5f54b5d587-djvzq-1-676924B2-13 2024-12-23 08:52:02.491869344 +0000 UTC m=+3324642.414284321 Received: from herokuapp.com (unknown) by geopod-ismtpd-11 (SG) with ESMTP id Rm1TzwT7RCyd6Vcb9FKlwg for ; Mon, 23 Dec 2024 08:52:02.392 +0000 (UTC) Date: Mon, 23 Dec 2024 08:52:02 +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: mame 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: 97052 X-SG-EID: =?us-ascii?Q?u001=2Ep+ckLDtT+4Y5c+H0YCkEnsuWiCQmn3OZA=2F9FzjoR6ZZlPaMv54M7EFoSM?= =?us-ascii?Q?CX5Trc79ep2R5F+0oYS4n23jq1cv0RKHYjBBEaD?= =?us-ascii?Q?AMLV+w8op5yQXJHZoCrpclgHTaO5Qs+odSDURhP?= =?us-ascii?Q?revck8BsylmtExHzzDerbwMb0EDx2tmh72fpr6a?= =?us-ascii?Q?FowfWUYsG9jS7etrn4hSdSBHJ5N19cyuUvzLkon?= =?us-ascii?Q?LB6QQfhneSvMsyKX=2FHOSJh83yfulfssL2Xs6qz4?= =?us-ascii?Q?29WN?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: U2SPCSHIV2LVVXAWA2KVEBAOOLHPTDZA X-Message-ID-Hash: U2SPCSHIV2LVVXAWA2KVEBAOOLHPTDZA 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:120375] [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: "mame (Yusuke Endoh) via ruby-core" Cc: "mame (Yusuke Endoh)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20965 has been updated by mame (Yusuke Endoh). I see. I think this is simply buggy. ```ruby "foo".tap do _1 "bar".tap do p binding.local_variable_get(:_1) #=> "foo" end end ``` IMO, meta-programming APIs for numbered parameters and `it` should be separated from `binding#local_variable*` because they are not a local variable. It would be good to consider them towards 3.5. ---------------------------------------- Bug #20965: `it` vs `binding.local_variables` https://bugs.ruby-lang.org/issues/20965#change-111152 * 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/