Project

General

Profile

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 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0