[#98621] Re: Function getlogin_r()'s protoype] — Bertram Scharpf <lists@...>
FYI,
3 messages
2020/06/02
[#98947] [Ruby master Feature#16986] Anonymous Struct literal — ko1@...
Issue #16986 has been reported by ko1 (Koichi Sasada).
66 messages
2020/06/26
[#98962] [Ruby master Bug#16988] Kernel.load loads file from current directory without '.' in path — misharinn@...
Issue #16988 has been reported by TheSmartnik (Nikita Misharin).
5 messages
2020/06/26
[#98969] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings — marcandre-ruby-core@...
Issue #16994 has been reported by marcandre (Marc-Andre Lafortune).
7 messages
2020/06/26
[#100117] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings
— matz@...
2020/09/25
Issue #16994 has been updated by matz (Yukihiro Matsumoto).
[ruby-core:98948] [Ruby master Feature#16985] Improve `pp` for `Hash` and `String`
From:
v.ondruch@...
Date:
2020-06-26 07:58:51 UTC
List:
ruby-core #98948
Issue #16985 has been updated by vo.x (Vit Ondruch).
I wish the hashrocket stays and the syntax is consistent without exceptions for symbol.
----------------------------------------
Feature #16985: Improve `pp` for `Hash` and `String`
https://bugs.ruby-lang.org/issues/16985#change-86324
* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
* Assignee: akr (Akira Tanaka)
----------------------------------------
Could we improve `pp` for `Hash` and `String`:
```ruby
pp({hello: 'My name is "Marc-Andr'})
# =>
{hello: 'My name is "Marc-Andr'}
# instead of
{:hello=>"My name is \"Marc-Andr饅""}
```
If any key is non-symbol, they would continue to be output as `<key> => <value>`. If a string contains single quotes, or characters that need escaping (e.g. `"\n"`), current format would be used.
I'll gladly provide a PR if this is deemed acceptable.
I would even like this for `String#inspect` and `Hash#inspect` but it's not clear if this could lead to much incompatibility (maybe test suites?)
--
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>