From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 2CE5B19E005C for ; Fri, 18 Dec 2015 12:43:24 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 3AA7FB5D905 for ; Fri, 18 Dec 2015 13:15:31 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 960AC18CC7E2 for ; Fri, 18 Dec 2015 13:15:31 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 70E521207BD; Fri, 18 Dec 2015 13:14:11 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) by neon.ruby-lang.org (Postfix) with ESMTPS id BC67212075C for ; Fri, 18 Dec 2015 13:13:34 +0900 (JST) Received: by mail-ig0-f174.google.com with SMTP id jw2so26820519igc.1 for ; Thu, 17 Dec 2015 20:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:subject:mime-version:content-type; bh=zrhhlS8vFLPiBP2FdvYEyOVj4VIQpPrvn9/n4EmET4M=; b=Ifum7/hqRdgtpz+Nv8Q3WGcof5EXxBwO6qCEe6/636aHA7xXWFVaziDDEMWUf9Zi+g DSEngtWf3F1CQfHQmRcBVS9j1faTKa4s7/4RdZC7TU1hqkUZqCiNIw9TigNV6t8qGXfs LjZ6Jl/4Jo1ZkhPk5a7G4Gtn6farILrnFvo+ByPZk9aICFZCgjgPXN/p9dVfiLKqz9nA w5HWa1jEIE7U66Yc+xPu2UankunBFPGG2j2djpdANKmrpCEP473qZBBwTdzSOfbL2NmW LTTnTzxeCroe5R4BYs93nKZpyd7BjEgTLQ5KODhzBeDigqqqOFX+D0buBHgLgF/hnANn SVlQ== X-Received: by 10.50.97.39 with SMTP id dx7mr435176igb.19.1450412013507; Thu, 17 Dec 2015 20:13:33 -0800 (PST) Received: from Josephe-Jones (75-166-130-47.hlrn.qwest.net. [75.166.130.47]) by smtp.gmail.com with ESMTPSA id e7sm1971333igc.2.2015.12.17.20.13.32 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Dec 2015 20:13:32 -0800 (PST) Date: Thu, 17 Dec 2015 21:13:32 -0700 From: Joseph Jones To: Ruby developers Cc: Message-ID: X-Mailer: BoxerFree 6.0.4 (321) X-Boxer-Generated: true X-Boxer-IsLike: true MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="567387ec_6c80ec70_16c" X-ML-Name: ruby-core X-Mail-Count: 72349 Subject: [ruby-core:72349] [Ruby trunk - Feature #11781] [Open] Would it be possible to alias .prepend() towards .unshift() for class Array by default? X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" --567387ec_6c80ec70_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 7, 2015 at 03:12:= 22 MST, shevegen=40gmail.com wrote:Issue =2311781 has been reported by Ro= bert A. Heiler.----------------------------------------=46eature =2311781= : Would it be possible to alias .prepend() towards .unshift() for class A= rray by default=3Fhttps://bugs.ruby-lang.org/issues/11781* Author: Robert= A. Heiler* Status: Open* Priority: Normal* Assignee: -------------------= ---------------------Hello.=46or Strings we can do: abc =3D 'world=21' ab= c=5B0,0=5D =3D 'Hello ' abc =23 =3D> =22Hello world=21=22=46or Arrays we = can do: abc =3D =5B'world=21'=5D abc=5B0,0=5D =3D 'Hello ' abc =23 =3D> =5B= =22Hello =22, =22world=21=22=5DThis is nice.=46or Strings we can also use= .prepend() to add to the beginning.=46or Arrays, we have to use .unshift= ().I have a hard time remembering .unshift though, .prepend() seemsto be = easier for me to remember.I'd like to use both .prepend for Strings and A= rrays; right nowI have to use different names. I could alias prepend to u= nshiftfor class Array, but then I'd have to carry these modificationsinto= my projects, which is not so good - I would prefer to juststick to what = MRI is doing.Could we have the alias .prepend() for class Array, meaning = .unshift() too=3F That way I could use .prepend() for both Arraysand Stri= ngs.Thanks for reading=21-- https://bugs.ruby-lang.org/ --567387ec_6c80ec70_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 7, 2015 at 03:12:22 MST, shevegen=40gmail.com wrote:
Issue =2311781 has been report= ed by Robert A. Heiler.

--------------------------------------= --
=46eature =2311781: Would it be possible to alias .prepend() towa= rds .unshift() for class Array by default=3F
https://bugs.ruby-lang.= org/issues/11781

* Author: Robert A. Heiler
* Status: Ope= n
* Priority: Normal
* Assignee:
------------------------= ----------------
Hello.

=46or Strings we can do:
abc =3D 'world=21'
abc=5B0,0=5D =3D 'Hello '
abc= =23 =3D> =22Hello world=21=22

=46or Arrays we can do:
abc =3D =5B'world=21'=5D
abc=5B0,0=5D =3D 'Hello '
= abc =23 =3D> =5B=22Hello =22, =22world=21=22=5D

This is ni= ce.

=46or Strings we can also use .prepend() to add to the beg= inning.

=46or Arrays, we have to use .unshift().

I = have a hard time remembering .unshift though, .prepend() seems
to be= easier for me to remember.

I'd like to use both .prepend for = Strings and Arrays; right now
I have to use different names. I could= alias prepend to unshift
for class Array, but then I'd have to carr= y these modifications
into my projects, which is not so good - I wou= ld prefer to just
stick to what MRI is doing.

Could we ha= ve the alias .prepend() for class Array, meaning
.unshift() too=3F = That way I could use .prepend() for both Arrays
and Strings.
Thanks for reading=21



--
https://bugs.ru= by-lang.org/
--567387ec_6c80ec70_16c--