From: adriaan1@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:81554] [Ruby trunk Bug#13623] meta-programming, adding sub-module fails with syntax error
Date: Sat, 03 Jun 2017 06:43:48 +0000 [thread overview]
Message-ID: <redmine.journal-65257.20170603064347.0a1f52eedb52bb7d@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13623.20170602143700@ruby-lang.org
Issue #13623 has been updated by caschip (Aad Schippers).
So you are saying this is how it should work and not a bug? If that is true, I should close this. What do you mean when you say that Object::const_get('Foo')::Bar is syntactically a constant. Its contains characters that are not appropriate in constant names, like brackets and single quotes, and a method is called, const_get, to evaluate it. To me it is an expression a::b::c with two scope operators, two constants (Object and Bar) and one method call that returns a constant const_get('Foo') => Foo.
----------------------------------------
Bug #13623: meta-programming, adding sub-module fails with syntax error
https://bugs.ruby-lang.org/issues/13623#change-65257
* Author: caschip (Aad Schippers)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
The goal is to add a sub-module to a higher level module. The higher level module is derived from its name in a string. This works in one case and gives an unexpected syntax error in another case.
failing_meta:4: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
failing_meta:8: syntax error, unexpected keyword_end, expecting end-of-input
---Files--------------------------------
no_meta (72 Bytes)
working_meta (82 Bytes)
failing_meta (95 Bytes)
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2017-06-03 6:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-13623.20170602143700@ruby-lang.org>
2017-06-02 14:37 ` [ruby-core:81528] [Ruby trunk Bug#13623] meta-programming, adding sub-module fails with syntax error adriaan1
2017-06-02 14:43 ` [ruby-core:81529] " adriaan1
2017-06-02 15:25 ` [ruby-core:81532] " shyouhei
2017-06-03 6:43 ` adriaan1 [this message]
2017-06-03 7:25 ` [ruby-core:81555] [Ruby trunk Bug#13623][Rejected] " nobu
2017-06-05 10:02 ` [ruby-core:81579] [Ruby trunk Bug#13623] " adriaan1
2017-06-05 10:24 ` [ruby-core:81580] " nobu
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.journal-65257.20170603064347.0a1f52eedb52bb7d@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).