L
Lionel Thiry
Hello!
I remember some posts saying that $ for globals will disapear from ruby2. Is it
still the case?
If I correctly remember arguments for that disapearance are:
1) short globals $', $:, etc, are too cryptic (and perlist)
2) globals are not good/true OO
3) globals may instead be managed through some module or class
module Globals
@my_global = "default value"
class <<self
attr_accessor :my_global
end
end
puts Globals::my_global # => default value
I remember some posts saying that $ for globals will disapear from ruby2. Is it
still the case?
If I correctly remember arguments for that disapearance are:
1) short globals $', $:, etc, are too cryptic (and perlist)
2) globals are not good/true OO
3) globals may instead be managed through some module or class
module Globals
@my_global = "default value"
class <<self
attr_accessor :my_global
end
end
puts Globals::my_global # => default value