Actions
Feature #12746
closed
Updated by nrodriguez (Nicolas Rodriguez) almost 9 years ago
Also .prepend
sounds more natural than .unshift
(specialy on Array). But it also implies .append
which should be aliased to .push
.
Example :
[1, 2, 3,].append(4).append(5)
Updated by matz (Yukihiro Matsumoto) over 8 years ago
Accepted.
Matz.
Updated by matsuda (Akira Matsuda) over 8 years ago
FIY both append and prepend are in ActiveSupport: https://.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/array/prepend_and_append.rb
Updated by JustJosh (Joshua Stowers) about 8 years ago
Thanks, Matz! I've been wanting this for a while.
I've just made a PR to the repo with the changes: https://.com/ruby/ruby/pull/1574
Updated by nobu (Nobuyoshi Nakada) about 8 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r58227.
array.c: Array#append and Array#prepend
- array.c (Init_Array): Add alias "append" to Array#push, and
"prepend" to Array#unshift. [Feature ] [Fix GH-1574]
Author: pascbjumper2 [email protected]
Actions
Like0Like0Like0Like0Like0Like0