From: knu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:65714] [ruby-trunk - Bug #10388] [Open] Operator precedence problem in multiple assignment (massign)
Date: Wed, 15 Oct 2014 03:35:52 +0000 [thread overview]
Message-ID: <redmine.issue-10388.20141015033552.11219d7fbcc4d9c2@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10388.20141015033552@ruby-lang.org
Issue #10388 has been reported by Akinori MUSHA.
----------------------------------------
Bug #10388: Operator precedence problem in multiple assignment (massign)
https://bugs.ruby-lang.org/issues/10388
* Author: Akinori MUSHA
* Status: Open
* Priority: Low
* Assignee: Yukihiro Matsumoto
* Category: syntax
* Target version:
* ruby -v: ruby 2.2.0dev (2014-10-13 trunk 47904) [x86_64-freebsd10]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
I understand it wouldn't be easy to fix this, but since I happened to find it here it goes.
- `a, b = c = 1, 2` is currently taken as `a, b = (c = 1), 2`; I'd expect it to be taken as `a, b = (c = 1, 2)`.
- `a, b = *c = 1, 2` is currently taken as `a, b = *(c = 1), 2`; I'd expect it to be taken as `a, b = *(c = 1, 2)` or even `a, b = (*c = 1, 2)`.
- `a, b = c, d = 1, 2` is currently taken as `a, b = (c), (d = 1), 2`; I'd expect it to be taken as `a, b = (c, d = 1, 2)`.
Should they be fixed/changed or not, issuing a warning would be greatly helpful.
--
https://bugs.ruby-lang.org/
next parent reply other threads:[~2014-10-15 3:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-10388.20141015033552@ruby-lang.org>
2014-10-15 3:35 ` knu [this message]
2019-08-20 20:33 ` [ruby-core:94450] [Ruby master Bug#10388] Operator precedence problem in multiple assignment (massign) merch-redmine
2020-01-16 6:18 ` [ruby-core:96890] " matz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.issue-10388.20141015033552.11219d7fbcc4d9c2@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).