This will be possible in Rubinius, but it requires savaging the source
code. Is there a way to do it in normal Ruby? Is source code savagery
required?
–
Giles B.
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/
On Nov 7, 2007, at 9:13 PM, Giles B. wrote:
Object.module_eval{ remove_const :Array }
??
a @ http://drawohara.tumblr.com/
Giles_B
November 8, 2007, 11:19am
3
heh… “…and thus the gates of hell were thrown open…”
Gotta love that about Ruby… you can even kiss a basic class like
Array goodbye with a single line of code.
I love ruby.
Mikel
On 11/8/07, Mikel L. [email protected] wrote:
heh… “…and thus the gates of hell were thrown open…”
Gotta love that about Ruby… you can even kiss a basic class like
Array goodbye with a single line of code.
I love ruby.
Object.module_eval{ remove_const :Array }
=> Array
/opt/local/lib/ruby/1.8/irb/slex.rb:72:in `match’: uninitialized
constant IRB::SLex::Array (NameError)
You could probably alias that to :implode.
–
–
Giles B.
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com/
Giles_B
November 9, 2007, 11:48am
5
Hi,
On Fri, 2007-11-09 at 03:21 +0900, Giles B. wrote:
/opt/local/lib/ruby/1.8/irb/slex.rb:72:in `match’: uninitialized
constant IRB::SLex::Array (NameError)
You could probably alias that to :implode.
That happens because irb then tries to use an Array internally and it no
longer exists. In normal Ruby interpreted code, it’ll work fine so far
as you use no arrays.