[#83096] File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?}) — Nobuyoshi Nakada <nobu@...>
On 2017/10/04 8:47, normal@ruby-lang.org wrote:
5 messages
2017/10/04
[#83100] Re: File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?})
— Eric Wong <normalperson@...>
2017/10/04
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#83105] Re: File.setuid? on IO (Re: [ruby-cvs:67289] normal:r60108 (trunk): file.c: release GVL in File.{setuid?, setgid?, sticky?})
— Nobuyoshi Nakada <nobu@...>
2017/10/04
On 2017/10/04 15:55, Eric Wong wrote:
[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>
Hello,
9 messages
2017/10/04
[#83113] Re: Alias Enumerable#include? to Enumerable#includes?
— "Urabe, Shyouhei" <shyouhei@...>
2017/10/05
This has been requested countless times, then rejected each and every time.
[#83129] Re: Alias Enumerable#include? to Enumerable#includes?
— Alberto Almagro <albertoalmagro@...>
2017/10/05
Sorry I didn't found it on the core mail list's archive.
[#83138] Re: Alias Enumerable#include? to Enumerable#includes?
— "Urabe, Shyouhei" <shyouhei@...>
2017/10/06
Ruby has not been made of popular votes so far. You have to show us
[#83149] Re: Alias Enumerable#include? to Enumerable#includes?
— Eric Wong <normalperson@...>
2017/10/06
Alberto Almagro <albertoalmagro@gmail.com> wrote:
[#83200] [Ruby trunk Feature#13996] [PATCH] file.c: apply2files releases GVL — normalperson@...
Issue #13996 has been reported by normalperson (Eric Wong).
4 messages
2017/10/10
[ruby-core:83417] [Ruby trunk Feature#14033] Alias String#<< as String#append
From:
mail@...
Date:
2017-10-20 06:43:13 UTC
List:
ruby-core #83417
Issue #14033 has been updated by sos4nt (Stefan Schüßler).
phluid61 (Matthew Kerwin) wrote:
> 1 [...] I would expect that a new word-based name for the dangerous operation would end with "!".
That contradicts `Array#append` / `Array#prepend`. And since `String#prepend` also modifies the receiver, I would expect `String#append` to work in a similar way.
(Off topic but IMO, `String#concat` is the one that should return a new string, just like the documentation for `String#+` says: _"Concatenation—Returns a new String containing other_str concatenated to str."_ But it's probably a bit late to fix that.)
> 2 [...] A method named to look like prepend, but that behaves like concat, is confusing.
Good point. I'm fine with string-only arguments. `append` would simply invoke `rb_str_append` then (is that a coincidence?).
> 3 [...] this alias would introduce confusion about which method (concat vs. append) has what arity.
It should of course work (arity-wise) like `Array#append`, i.e. accept multiple argument. I should have said "concat", not "<<" in the question's title.
---
To avoid any further confusion: I'm proposing a _new_ method `String#append` with the following signature:
> ### append(other_str1, other_str2,...) → str
> Append—Append the given strings to _str_.
>
>```ruby
> a = "hello "
> a.append("world", "!") #=> "hello world!"
> a #=> "hello world!"
> ```
>
> See also _#concat_.
----------------------------------------
Feature #14033: Alias String#<< as String#append
https://bugs.ruby-lang.org/issues/14033#change-67382
* Author: sos4nt (Stefan Schüßler)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Ruby 2.5 introduces `Array#append` as an alias for `<<` / `push`.
Likewise, there should be `String#append` as an alias for `<<` / `concat`. The documentation for `<<` even says "append":
> Append—Concatenates the given object to str. [...]
And `String` already has a `prepend` method.
--
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>