From: Robert Klemme Date: 2003-02-03T22:13:54+09:00 Subject: Re: Local variables & blocks schrieb im Newsbeitrag news:20030203205757.22039@kana.fenix.ne.jp... > Hi, > > In message "Re: Local variables & blocks" > on 03/02/03, matz writes: > > >| I think, it should be a first-class special value like #. > > Hmm, "nil" is a special value for uninitialized slot. > > If # were newly established, what value can I get from > following code? > > if # then > foo = true > else > foo = nil > end > > I say again, double meaning may be harmful. There's no double meaning. As matz pointed out, this is exactly what nil is for. I don't see any advantage in creating another distinction between nil and # - IMHO this is artifical. If you really needed the distinction (which I guess is rare), you could introduce a additional boolean flag for this. def blocktest(*args) args.each do |arg| initialized = true foo = (foo or arg) end p "not initialized" unless initialized end Note: 'and' operation does not make much sense for aggregation here without initialization since 'nil and ' always yields 'nil'. Second Note: I guess, you forgot the braces since 'and' has lower precedence than '='. Your original code would have been grouped like this: (foo = foo) and arg, which would always leave foo as nil. Regards robert