From: Yukihiro Matsumoto Date: 2019-09-28T13:42:19+09:00 Subject: [ruby-core:95143] Re: [Ruby master Feature#16150] Add a way to request a frozen string from to_s Hi, In message "Re: [ruby-core:95142] [Ruby master Feature#16150] Add a way to request a frozen string from to_s" on Sat, 28 Sep 2019 04:33:32 +0000 (UTC), headius@headius.com writes: >Issue #16150 has been updated by headius (Charles Nutter). > > >> Not exactly, -@ and +@ makes this much simpler > >I do like the unary operators, but they also have some precedence oddities: > >``` >>> -"foo".size >=> -3 >>> (-"foo").size >=> 3 >``` > >And it doesn't work at all if you're chaining method calls: How about making String#+ and #- without argument behave like #+@ and #-@ respectively, so that we can write: ``` "foo".-.size ary.+.to_s.frozen? ``` matz. Unsubscribe: