From: Robert Klemme Date: 2006-02-23T18:18:34+09:00 Subject: Re: setting nil to zero Botp wrote: > Hi, > > is there a setting to set nil to zero? something like $NIL=0, then > set it back again to $NIL=nil... > > reason is i have quite a number of codes like ff > > s.each do |w| > f[w] = 0 unless f[w] #i want to kill this lne since it does not > jive with my pseudocode > f[w] += 1 > end .... and if f is not a Hash you can do f[w] = (f[w] || 0) + 1 Kind regards robert