Feature #6242
closedRuby should support lists
Added by shugo (Shugo Maeda) over 13 years ago. Updated over 2 years ago.
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
Files
list.diff (9.61 KB) list.diff | shugo (Shugo Maeda), 04/01/2012 12:17 PM | ||
list2.diff (9.61 KB) list2.diff | shugo (Shugo Maeda), 04/01/2012 02:10 PM | ||
list3.diff (14 KB) list3.diff | shugo (Shugo Maeda), 04/01/2012 11:14 PM | ||
noname (500 Bytes) noname | Anonymous, 04/02/2012 10:59 AM | ||
noname (500 Bytes) noname | Anonymous, 04/02/2012 11:23 AM | ||
jaro-1.jpg (12.3 KB) jaro-1.jpg | rohansoni619 (Rohan Soni), 06/08/2013 02:20 PM |
Updated by shugo (Shugo Maeda) over 13 years ago
Actions
#1
[ruby-core:44039]
- File list2.diff list2.diff added
Updated the patch to evaluate x ::: y' as
y.:::(x)', not `x.:::(y)'.
Updated by shugo (Shugo Maeda) over 13 years ago
Actions
#2
[ruby-core:44040]
- File list3.diff list3.diff added
Updated the patch to add methods: foldl, foldr, +, flatten/concat, map, flat_map/concat_map,
filter, length/size, sum, reverse.
Updated by drbrain (Eric Hodel) over 13 years ago
Actions
#3
[ruby-core:44045]
I have heard Ruby is a LISP too:
http://www.jwz.org/blog/2012/03/haters-gonna-hate-tail-call-optimization/#comment-103386
Updated by shugo (Shugo Maeda) over 13 years ago
Actions
#4
[ruby-core:44048]
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.
Updated by xds2000 (deshi xiao) over 13 years ago
Actions
#5
[ruby-core:44049]
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.
Updated by drbrain (Eric Hodel) over 13 years ago
Actions
#6
[ruby-core:44050]
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
Updated by shugo (Shugo Maeda) over 13 years ago
Actions
#7
[ruby-core:44055]
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ノ
Updated by Anonymous over 13 years ago
Actions
#8
[ruby-core:44054]
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/
Updated by Anonymous over 13 years ago
Actions
#9
[ruby-core:44056]
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/
Updated by spatulasnout (B Kelly) over 13 years ago
Actions
#10
[ruby-core:44057]
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.
:)
Updated by jballanc (Joshua Ballanco) over 13 years ago
Actions
#11
[ruby-core:44058]
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=
:)
Updated by mame (Yusuke Endoh) over 13 years ago
Actions
#12
[ruby-core:44070]
- Status changed from Open to Rejected
April fools' day ended. Thanks.
--
Yusuke Endoh mame@tsg.ne.jp
Updated by jamesw (James Owen) about 13 years ago
Actions
#13
[ruby-core:47708]
even i guess so Ruby is a LISP
Updated by sumit (sumit ghosh) over 12 years ago
Actions
#14
I doubt that ruby is LISP.
http://www.ifeel.edu.in
Updated by jasonsmith (jason smith) over 12 years ago
Actions
#15
[ruby-core:54650]
List processing is a draw back??
http://www.venkotech.com
Updated by rohansoni619 (Rohan Soni) over 12 years ago
Actions
#16
[ruby-core:55366]
- File jaro-1.jpg jaro-1.jpg added
I think ruby is a LISP.
http://www.jaro.in/international-MBA-1-year.html
Updated by huma10 (huma mustqeem) over 7 years ago
Actions
#17
[ruby-core:85246]
jamesw (James Owen) wrote:
even i guess so Ruby is a LISP
Yes agree with you
https://leatherbaba.com/genuine-leather-motorcycle-jacket
Updated by jacketskingdom (Jackets Kingdom) over 2 years ago
Actions
#18
[ruby-core:113284]
i agree with you and see more about punk clothing.
https://jacketskingdom.com/collections/punk-leather-jacket