From: adriaan1@... Date: 2017-06-03T06:43:48+00:00 Subject: [ruby-core:81554] [Ruby trunk Bug#13623] meta-programming, adding sub-module fails with syntax error 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/ Unsubscribe: