mernen (owner)

Revisions

gist: 30200 Download_button fork
public
Public Clone URL: git://gist.github.com/30200.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
# Feeling Lispy?
 
number = 1234
(def method_missing m ,s ,*a ,&b
  (s.send m ,*a ,&b) end)
 
# Ruby 1.8.6 w/ ActiveSupport
(puts (reverse (join (collect (in_groups_of (reverse (Array (chars (String number)))) ,3) ,&:join) ,",")))
 
# Ruby 1.8.7+, no ActiveSupport dependency
(puts (reverse (join (collect (each_slice (reverse (Array (chars (String number)))) ,3) ,&:join) ,",")))