Feature #6242

Ruby should support lists

Added by Shugo Maeda about 2 years ago. Updated 11 months ago.

[ruby-core:44036]
Status:Rejected
Priority:Normal
Assignee:-
Category:Joke
Target version:2.0.0

Description

I've heard that Ruby is a LISP.
LISP stands for "LISt Processing."
Hence, Ruby should support lists.

I've attached a patch to add the classes List and Cons, and the cons operator `:::'.

Example:

S[1,2,3].inject(:+)
=> 6
S[1,2,3]
=> S[1, 2, 3]
0 ::: S[1,2,3]
=> S[0, 1, 2, 3]
0 ::: 1 ::: 2 ::: 3 ::: nil
=> S[0, 1, 2, 3]
S[1,2,3].inject(:+)
=> 6

list.diff Magnifier (9.61 KB) Shugo Maeda, 04/01/2012 12:17 PM

list2.diff Magnifier (9.61 KB) Shugo Maeda, 04/01/2012 02:10 PM

list3.diff Magnifier (14 KB) Shugo Maeda, 04/01/2012 11:14 PM

noname (500 Bytes) Anonymous, 04/02/2012 10:59 AM

noname (500 Bytes) Anonymous, 04/02/2012 11:23 AM

jaro-1.jpg (12.3 KB) Rohan Soni, 06/08/2013 02:20 PM

History

#1 Updated by Shugo Maeda about 2 years ago

Updated the patch to evaluate x ::: y' asy.:::(x)', not `x.:::(y)'.

#2 Updated by Shugo Maeda about 2 years ago

Updated the patch to add methods: foldl, foldr, +, flatten/concat, map, flatmap/concatmap,
filter, length/size, sum, reverse.

#4 Updated by Shugo Maeda about 2 years ago

drbrain (Eric Hodel) wrote:

I have heard Ruby is a LISP too:

http://www.jwz.org/blog/2012/03/haters-gonna-hate-tail-call-optimization/#comment-103386

Thanks for the information. I forgot to propose macros.

But the following comment reminded me that Ruby was originally Smalltalk, not a LISP.

http://www.jwz.org/blog/2012/03/haters-gonna-hate-tail-call-optimization/#comment-103406

I'm afraid this issue might be rejected.

#5 Updated by deshi xiao about 2 years ago

Hi,shugo
What benefits of the proposed lisp changed? I am very confuse this LISP list feature. your sample is very similar with native ruby Hash in my options.

#6 Updated by Eric Hodel about 2 years ago

shugo (Shugo Maeda) wrote:

But the following comment reminded me that Ruby was originally Smalltalk, not a LISP.

http://www.jwz.org/blog/2012/03/haters-gonna-hate-tail-call-optimization/#comment-103406

I'm afraid this issue might be rejected.

Maybe we should propose a free ":" after method names for keyword arguments in a separate issue, like:

open: "file.txt", mode: "r+", encoding: Encoding::UTF_8 do |io|
# …
end

Then we can have the best of LISP and Smalltalk

#7 Updated by Shugo Maeda about 2 years ago

xds2000 (deshi xiao) wrote:

Hi,shugo
What benefits of the proposed lisp changed? I am very confuse this LISP list feature. your sample is very similar with native ruby Hash in my options.

  ∧,,∧
 (,,・∀・) You should say "Array", not "Hash"!
~(_u,uノ

#8 Updated by Anonymous about 2 years ago

On Mon, Apr 02, 2012 at 09:14:30AM +0900, xds2000 (deshi xiao) wrote:

Issue #6242 has been updated by xds2000 (deshi xiao).

Hi,shugo
What benefits of the proposed lisp changed? I am very confuse this LISP list feature. your sample is very similar with native ruby Hash in my options.

Hi, this is a joke ticket for April fool's day. Don't take it too
seriously! :-)

https://img.skitch.com/20120402-bt88qqb8jitx92kqyuq4yh4rdx.jpg

--
Aaron Patterson
http://tenderlovemaking.com/

#9 Updated by Anonymous about 2 years ago

On Mon, Apr 02, 2012 at 10:56:47AM +0900, shugo (Shugo Maeda) wrote:

Issue #6242 has been updated by shugo (Shugo Maeda).

xds2000 (deshi xiao) wrote:

Hi,shugo
What benefits of the proposed lisp changed? I am very confuse this LISP list feature. your sample is very similar with native ruby Hash in my options.

  ∧,,∧
 (,,・∀・) You should say "Array", not "Hash"!
~(_u,uノ

(ノಠ益ಠ)ノ彡┻━┻

--
Aaron Patterson
http://tenderlovemaking.com/

#10 Updated by B Kelly about 2 years ago

shugo (Shugo Maeda) wrote:

But the following comment reminded me that Ruby was originally Smalltalk, not a LISP.

http://www.jwz.org/blog/2012/03/haters-gonna-hate-tail-call-optimization/#comment-103406

I used to think so too, until I saw this:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/336646

Clearly Ruby has been a stealth-Lisp all along.

:)

#11 Updated by Joshua Ballanco about 2 years ago

On Sunday, April 1, 2012 at 10:40 PM, Bill Kelly wrote:

shugo (Shugo Maeda) wrote:

But the following comment reminded me that Ruby was originally Smalltalk, not a LISP.

http://www.jwz.org/blog/2012/03/haters-gonna-hate-tail-call-optimization/#comment-103406

I used to think so too, until I saw this:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/336646

Clearly Ruby has been a stealth-Lisp all along.

Ah! Our old friend Pascal… I remember him well. I ran across him not to long ago. Seems he's moved on to Lua now: http://article.gmane.org/gmane.comp.lang.lua.general/81364/match=

:)

#12 Updated by Yusuke Endoh about 2 years ago

  • Status changed from Open to Rejected

April fools' day ended. Thanks.

Yusuke Endoh mame@tsg.ne.jp

#13 Updated by James Owen over 1 year ago

even i guess so Ruby is a LISP

http://www.leatherfads.com/leather-jacket.aspx

#14 Updated by sumit ghosh 12 months ago

I doubt that ruby is LISP.
http://www.ifeel.edu.in

#15 Updated by jason smith 12 months ago

List processing is a draw back??
http://www.venkotech.com

#16 Updated by Rohan Soni 11 months ago

Also available in: Atom PDF