[#109207] [Ruby master Feature#18915] New error class: NotImplementedYetError or scope change for NotImplementedYet — Quintasan <noreply@...>
Issue #18915 has been reported by Quintasan (Michał Zając).
18 messages
2022/07/14
[ruby-core:109172] [Ruby master Bug#18905] :"@=".inspect is non-evaluatable
From:
"sawa (Tsuyoshi Sawada)" <noreply@...>
Date:
2022-07-09 14:44:44 UTC
List:
ruby-core #109172
Issue #18905 has been updated by sawa (Tsuyoshi Sawada). Not sure what you mean. `inspect` is expected to return a string, and the cases you mention indeed return a string respectively. ```ruby :"@=".inspect #=> ":@=" :"[][]=".inspect #=> ":\"[][]=\"" :"$$$$=".inspect #=> ":$$$$=" ``` However, among them, `:"@=".inspect` and `:"$$$$=".inspect` do not include quotations. Is that what you are at? ---------------------------------------- Bug #18905: :"@=".inspect is non-evaluatable https://bugs.ruby-lang.org/issues/18905#change-98312 * Author: qnighy (Masaki Hara) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- There is an edge case where `Symbol#inspect` returns a non-evaluatable expression: ```ruby :"@=".inspect # => :@= :"[][]=".inspect # => :[][]= :"$$$$=" # => :$$$$= ``` More specifically, the quotations are stripped if the following conditions are met (but the converse does not hold): - It starts with `@`, `@@`, `$` or `[`, - the prefix is not followed by an identifier, and - it ends with `=`. But the rule should only apply to `:$=` and `:[]=`, because (in my understanding) we should generally have `eval(sym.inspect) == sym` for the programmers' convenience. -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>