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 [IPv6:2a01:4f8:1c0c:6b10::1]) (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 6C7A91F406 for ; Fri, 25 Aug 2023 03:57:52 +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=QjfXYN9i; 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=AUSxCmDd; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 85DAF7FBEE; Fri, 25 Aug 2023 03:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1692935847; bh=UrJVC4i0DfUrIHJIhr4r0JZi5WkKu2D+CxR0HiFiP2s=; 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=QjfXYN9i4tp3iCEyQRhSoCblmLRNllbbVAOVhG7X1BtAWnEt0tFX3+nQFI9Fg3uip ylQ5EcgBnE7z5RQ12fGk/Y6ZqWLczatByq5srLocGeXaWT3E5PkB44Ky9AHwTRGMtx 4oSrYdR83D80Ru69F9bEICryYFVG4XFCQ+FJaK9I= Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 048377FBDC for ; Fri, 25 Aug 2023 03:57:22 +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=AUSxCmDd; 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=pymURWWMRKztRivdaQNTFUctwbLkRYfGZB8eCc0+6Bs=; b=AUSxCmDdzx4yoBQivlUJ1L0udqaWa6DllsjpYbKQjCQqwrqQ3h+ypuLdZVN4iUHDdnsS Cghb7ATLFcNjosQ6IWAsC4cnCZLpwBjLMyrlQoVBKp+v/O86ShQUMuwG21JLxarPS9DNxo EvSq/nqELDEClm9bgLOPFsUSbnh2uUJT7YwxfhZ7s1wK9lU1v/4YEXpe7/mzLFKRzcGEZ9 Vdvzm4dfkWDowSftf6gqfQ3laOE/3TEWU4QE4CXOhk9QBX8Bf/4BylBFtvnXlCt2m0tQ6g zvaWVdEkPDqIax8OE45qBjRRtnNR6InUrj/cCc1RgPydOdYx028p2p8zXGd5vN2g== Received: by filterdrecv-canary-56575c7785-wd5jg with SMTP id filterdrecv-canary-56575c7785-wd5jg-1-64E826A1-6 2023-08-25 03:57:21.308205549 +0000 UTC m=+9173950.089708948 Received: from herokuapp.com (unknown) by geopod-ismtpd-24 (SG) with ESMTP id Cbg4SMziRCGZv7PhwSwdzg for ; Fri, 25 Aug 2023 03:57:21.165 +0000 (UTC) Date: Fri, 25 Aug 2023 03:57:21 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17925 X-Redmine-Issue-Author: koic 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: 91026 X-SG-EID: =?us-ascii?Q?rA5eEsXeCy+asKowYcicHxhOSUaOWYD+XnPnBc7LFC8Re9tNQ4Sv5BA=2FOz+glG?= =?us-ascii?Q?+50K4steq4vSjkkyeSAt=2FQpZK6mQgZdK22n=2FlxG?= =?us-ascii?Q?4Fre1DvVa9kyCe2zefngVbn=2FG3ZieMzUr=2FlBZlg?= =?us-ascii?Q?UhUTw9=2FSXiueLW1jCQTZ+YcaFdHovxtljxQjGoF?= =?us-ascii?Q?JKzLMQS2dHaT+DMMQVGQyVYX6W0wOqyAzP9=2FEPO?= =?us-ascii?Q?UX2xI0R+uB=2FD8rUkhAJdYYMVC=2FfBYYSWLO+pKOc?= =?us-ascii?Q?4Bs24L8u8lcqI0sCafMaQ=3D=3D?= To: ruby-dev@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: KKE7UMC5NRPK3HDVPC563N2H7CCB6QT2 X-Message-ID-Hash: KKE7UMC5NRPK3HDVPC563N2H7CCB6QT2 X-MailFrom: bounces+313651-12dc-ruby-dev=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 (Japanese)" Subject: =?utf-8?q?=5Bruby-dev=3A52041=5D_?= [Ruby master Bug#17925] Pattern matching syntax using semicolon one-line List-Id: "Ruby developers (Japanese)" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "nobu (Nobuyoshi Nakada) via ruby-dev" Cc: "nobu (Nobuyoshi Nakada)" Issue #17925 has been updated by nobu (Nobuyoshi Nakada).=0D =0D =0D I thought it a trade-off.=0D To allow the statement, one-line pattern matching is not allowed there.=0D But it returns `true`/`false` only and may be useless for `case`.=0D =0D ----------------------------------------=0D Bug #17925: Pattern matching syntax using semicolon one-line=0D https://bugs.ruby-lang.org/issues/17925#change-104322=0D =0D * Author: koic (Koichi ITO)=0D * Status: Open=0D * Priority: Normal=0D * ruby -v: ruby 3.1.0dev (2021-05-28T16:34:27Z master e56ba6231f) [x86_64-d= arwin19]=0D * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN=0D ----------------------------------------=0D ## Summary=0D =0D There are the following differences between `case ... when` and` case ... i= n`. Is this an expected behavior?=0D =0D ```console=0D % ruby -v=0D ruby 3.1.0dev (2021-05-28T16:34:27Z master e56ba6231f) [x86_64-darwin19]=0D =0D % ruby -ce 'case expression when 42; end'=0D Syntax OK=0D =0D % ruby -ce 'case expression in 42; end'=0D -e:1: warning: One-line pattern matching is experimental, and the behavior = may change in future versions of Ruby!=0D -e:1: syntax error, unexpected `end', expecting `when'=0D case expression in 42; end=0D ```=0D =0D So, I have two concerns.=0D =0D - Since the pattern matching syntax is different from `case ... when`,=E3= =80=80can't user write semicolon one-line `case ... in` in the same semicol= on one-line as `case ... when`?=0D - Does `case expression in 42; end` display an experimental warning of one-= line pattern matching. Right?=0D =0D This is reproduced in Ruby 3.1.0-dev and Ruby 3.0.1.=0D =0D ## Additional Information=0D =0D NOTE 1: I understand that only syntax that doesn't use `case` and `end` is = experimental one-line pattern matching syntax.=0D =0D ```=0D % ruby -ce 'expression in 42'=0D -e:1: warning: One-line pattern matching is experimental, and the behavior = may change in future versions of Ruby!=0D Syntax OK=0D ```=0D =0D NOTE 2: The syntax is OK if a semicolon is used between `expression` and `i= n`. But `case ... when` is a valid syntax to omit.=0D =0D ```=0D % ruby -e ruby -ce 'case expression; in 42; end'=0D Syntax OK=0D ```=0D =0D =0D =0D --=20=0D https://bugs.ruby-lang.org/=0D