| cdcarter | any parse_tree guru in here? |
| apeiros | um, nice, from http://seattlerb.rubyforge.org/ImageScience.html: ah, wait.. I didn't do the selfupdate |
| hagabaka | hmm is it an error to access an instance variable that hasn't been initialized? in irb i seem to just get nil |
| AnalphaBestie | nil is right |
| apeiros | it raises a warning and returns nil err, not raises it spits out a warning with -w |
| hagabaka | oh i was going to write a lazy accessor with @a || @a = value |
| AnalphaBestie | @a ||= value |
| apeiros | you mean @a ||= value? |
| hagabaka | ok |
| apeiros | that works slightly different and is ok |
| hagabaka | but that could trigger a warning? |
| apeiros | shouldn't give a warn there |
| hagabaka | hmm |
| apeiros | nope, no warning. |
| hagabaka | why is that? |
| cdcarter | because it knows what you mean |
| apeiros | special treatment it seems @foo ||= "foo" => "foo" @bar = @bar || "bar" (irb):2: warning: instance variable @bar not initialized => "bar" |
| cdcarter | it will treat it like an assignment (which it is) |
| AnalphaBestie | @foo = :bar rescue :baz err |
| apeiros | hu? wtf? root 7650 1.4 0.0 31488 500 p1 S+ 4:15AM 0:00.01 i686-apple-darwin8-g++-4.0.1 |
| hagabaka | can i launch irb with -w? |
| apeiros | what does that on my g5? |
| AnalphaBestie | i should go in my bed |
| hagabaka | i think "@a or @a = 5" would be more appropriate since it doesn't assign if it's defined...unless it gives warning but i can't figure out how to get -w in irb |
| cdcarter | $VERBOSE = true should do it |
| AnalphaBestie | hagabaka: thats why ||= exists, it only defines it if its undefined |