[#81492] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — normalperson@...

Issue #13618 has been reported by normalperson (Eric Wong).

12 messages 2017/06/01

[ruby-core:81580] [Ruby trunk Bug#13623] meta-programming, adding sub-module fails with syntax error

From: nobu@...
Date: 2017-06-05 10:24:33 UTC
List: ruby-core #81580
Issue #13623 has been updated by nobu (Nobuyoshi Nakada).


caschip (Aad Schippers) wrote:
> Statement 'module' requires a name that does not exist in the scope yet.

A (small) correction: it may exist syntactically,

```
$ ruby -c -e 'X=1; module X; end'
Syntax OK
```

but a `TypeError` will be raised at runtime if it is not a `Module`.

```
$ ruby -e 'X=1; module X; end'
Traceback (most recent call last):
-e:1:in `<main>': X is not a module (TypeError)
```


----------------------------------------
Bug #13623: meta-programming, adding sub-module fails with syntax error
https://bugs.ruby-lang.org/issues/13623#change-65283

* Author: caschip (Aad Schippers)
* Status: Rejected
* 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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next