Martin DeMello wrote:
> On 8/24/06, rak rok <rakrok / gmail.com> wrote:
>> Is there any way to have a proc object be callable identically to a method,
>> ie with the parentheses?  Is there a reason to keep the notation distinct?
> 
> No, mostly because () is not a method, it's syntax. [] on the other
> hand is a method, and therefore available for Proc#[] to be aliased to
> Proc#call
> 
> martin

oka...please explain for me where |base| parameter is comming 
from...irb:
> [4]power(5)
yntaxError: compile error
irb):9: syntax error
4]power(5)
       ^
       from (irb):9
> end
yntaxError: compile error
irb):10: syntax error
       from (irb):10
> 4.power(5)
> #<Proc:0x02dc58f0@(irb):2>
> power(5).4
yntaxError: compile error
irb):12: no .<digit> floating literal anymore; put 0 before dot
ower(5).4
        ^
irb):12: syntax error
       from (irb):12
> power(4)[4]
> 256
> power(4)0.4
yntaxError: compile error
irb):14: syntax error
       from (irb):14
> power(5)[4]
> 1024

-- 
Posted via http://www.ruby-forum.com/.