On 11/04/2008, Yohanes Santoso <[EMAIL PROTECTED]> wrote:

> > 12:57:18 PM Rie!: how come it's not a bug :-B var should be undefined local
>  > var
>
>
> Feature. Mekanisme yang sama memungkinkan expresi ini:
>
>  def foo
>   a = a || 2
>  end

i c

>  Untuk assignment, the destination variable selalu dibuat dahulu dan
>  bound ke value ``nil`` jika sebelumnya tidak ada, sebelum mengevaluasi
>  expresi di sisi kanan. Maka dari itu, reference ke ``a`` di sisi kanan
>  tidak erroring out.

> > 12:56:01 PM Rie!: it's just like the stupid param variable is still
>  > available outside of the block/yield
>
>
> Contoh?

no worries, nome, that was part of emotional talk from deeeep beneath
my hungry potbelly -_- that's been fixed since "centuries" ago with
ruby19.

ruby-1.8.6
---------------

#!/usr/bin/env ruby

e = 3
puts e
("01".."12").map { |e| "ariekeren #{e}" }
puts e

output
---------

3
12

ruby19
----------

#!/usr/bin/env ruby19

e = 3
puts e
("01".."12").map { |e| "ariekeren #{e}" }
puts e

output
---------

3
3

>  YS

gotta run to have dinner gotta go now ... c ya! thanks a lot!!!

-- 
blog: http://tinyurl.com/2bjgvn,
ruby: http://www.ruby-lang.org/id/about

"Developer Time is expensive...
Servers are cheap...", Ezra Zygmuntowicz - Merb

Kirim email ke