2.0.0-p451 :001 > [1,2].map { |i| % i }
 => ["i", "i"]
# within a block it is ok

2.0.0-p451 :002 > % i
2.0.0-p451 :003"> "
2.0.0-p451 :004">

# top level it is not working.

But when the same I am writing in my test.rb file, both are working :

[1, 2, 3].map { |i| % i } # => ["i", "i", "i"]

% i  # => "i"

Why in IRB *% i* didn't give *"i"* ?

-- 
================
Regards,
Arup Rakshit
================
Debugging is twice as hard as writing the code in the first place. Therefore, 
if you write the code as cleverly as possible, you are, by definition, not 
smart enough to debug it.

--Brian Kernighan