From: Robert Dober Date: 2007-04-14T22:31:09+09:00 Subject: Re: Idiom wanted (now hiring!) On 4/14/07, Christian Neukirchen wrote: > "Robert Dober" writes: > > > On 4/13/07, Nobuyoshi Nakada wrote: > >> Hi, > >> > >> At Fri, 13 Apr 2007 17:57:47 +0900, > >> Robert Dober wrote in [ruby-talk:247783]: > >> > > a = func(b) || a > >> > and if a did not exist before? > >> > >> a does exist at the assignment and initialized as nil. > >> > >> -- > >> Nobu Nakada > >> > >> > > Thx Nobu, that is as a matter of fact a "logical" and "functional" > > explanation, but my question was rather conceptional. > > Do make it clear I will be a little bit blunt, forgive me. > > I do not like that behavior! > > And you ? > > It's very philosophical: > > $ ruby -e 'thing = thing; p thing' > nil That might be to my liking too if there were not ====================== 501/1 > ruby -e '@x=@x;p @x' nil ---------------------------> 503/3 > ruby -e 'p @x' nil ====================== 504/4 > ruby -e 'x=x;p x' nil --------------------------> 505/5 > ruby -e 'p x' -e:1: undefined local variable or method `x' for main:Object (NameError) ====================== You see it is not the isolated semantics of x=x, but the context of other semantics that disturbs me (well disturbs me just a tiny little bit ;). Cheers Robert > > -- > Christian Neukirchen http://chneukirchen.org > >