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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3D4361F44D for ; Fri, 26 Apr 2024 08:28:39 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=C2WxlmzW; 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=OaUDY5H7; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 412A7844F3; Fri, 26 Apr 2024 08:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1714120112; bh=5gxWfAotJ9j8pNTnu48tbBnj8ODw4VVzOW04Inss4/c=; 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=C2WxlmzW/Prbx8nfl0Ve+CZ7yhQ+a3vUsPMEU9bLr/AIIeSmzWPyazMwXS9LJQ0oL ntaAz26X2cwcLKuzYYm1X9PLMfbJ5iolL04oT08hJuVrktAsLLuwahJAY8u/Olsx/8 E1uUr9UCZr+086+IijG6DrOi5G3/owO8//hi6jPc= Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id BB121844EC for ; Fri, 26 Apr 2024 08:28: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=OaUDY5H7; dkim-atps=neutral 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=YYVqJE8zoieYzTgI1LPYAPQCA1Ul9d66HqorJVDuU/g=; b=OaUDY5H7LzsFmHho5TESqRdNJbb3tkSr5sv6svOYKvhbdvyqPgJuqeMUoEiZM5ODUeug 3mxpRZB/Gk0BMtZPjvXRqJtjyV/sva3qucP4gnfnyxI/re5ofZnqD8j9OpYEXzswthma5r +rsLGhN0pzKso61POhJekqKy2FX5o09TeIguEgalTa4FcgUMIMMsRVnZplr+m0RR6bGMhR pl82cu7gelV/f3q0p5w/J/H0ljGu3JJOC0q8I8VVNDmTdUs8O1l0kscvF9twqCNcTar6Jz o6NZNhFKHCCRQ3ykO8AqWM8XP9CYCDOIYhCuMzc60KYGwVAxHaqADLat+WfXbIcA== Received: by filterdrecv-54566fd897-jsjjs with SMTP id filterdrecv-54566fd897-jsjjs-1-662B65AB-8 2024-04-26 08:28:27.626738944 +0000 UTC m=+1161631.515755232 Received: from herokuapp.com (unknown) by geopod-ismtpd-18 (SG) with ESMTP id EQi1vkptT9irXl0QQfqYfw for ; Fri, 26 Apr 2024 08:28:27.561 +0000 (UTC) Date: Fri, 26 Apr 2024 08:28:27 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 20444 X-Redmine-Issue-Author: esad X-Redmine-Issue-Priority: Normal X-Redmine-Sender: nobu 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: 94318 X-SG-EID: =?us-ascii?Q?u001=2E5PtzXJ23KrYzgM1nrOIr+EQ222PyrDaWSg0Er8CZ8tP86xyXmBM81zBKD?= =?us-ascii?Q?HreavdFYMbHjxXOR6UPMkt=2Fu9CyBIp6y52n8D2y?= =?us-ascii?Q?qA9zqurrgUfLeDCX8T42gffTLPwxLN25bdYcvTX?= =?us-ascii?Q?g6Sjh68=2FnYC3KgQ7oOEpMRM10WFRqe5LqLzFGw1?= =?us-ascii?Q?cWBQ8QmJWcntd=2Fer=2FFiZs2qOuFhNZQUfqlg0zZN?= =?us-ascii?Q?+XN7=2FqnemDffX+BhV+IO9z62qOG6nawh1z6G8Uf?= =?us-ascii?Q?2nwLKEVnbYQjqx80eABNYWirPA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 6KBXM7A4QHH3W4SVIZ76BPK7SP7JDQ35 X-Message-ID-Hash: 6KBXM7A4QHH3W4SVIZ76BPK7SP7JDQ35 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.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117722] [Ruby master Feature#20444] Kernel#loop: returning the "result" value of StopIteration doesn't work when raised directly List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "nobu (Nobuyoshi Nakada) via ruby-core" Cc: "nobu (Nobuyoshi Nakada)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20444 has been updated by nobu (Nobuyoshi Nakada). That example does not need `Ractor`. ```ruby class MyStop < ::StopIteration attr_reader :result def initialize(result) @result = result end end block = proc {raise StopIteration, 3} p Thread.start {loop {block.call}}.value #=> nil block = proc { raise MyStop, 3 } p Thread.start {loop {block.call}}.value #=> 3 ``` ---------------------------------------- Feature #20444: Kernel#loop: returning the "result" value of StopIteration doesn't work when raised directly https://bugs.ruby-lang.org/issues/20444#change-108130 * Author: esad (Esad Hajdarevic) * Status: Feedback ---------------------------------------- There was a https://bugs.ruby-lang.org/issues/11498 a while ago which was merged in, but I was surprised to find out that raising `StopIteration` in a loop like `loop { raise StopIteration.new(3) }` returns nil and not 3. -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/