From: Eric Christopherson Date: 2012-03-01T08:11:27+09:00 Subject: Re: Rubymoticons 2012/2/29 Bartosz DziewoƄski : > 2012/2/29 Eric Christopherson : >>> That makes sense, but it should be smart enough to realize that it's a >>> symbol.... >>> >>> -Dave >> >> Also, it should then take the next line entered and attempt to use it >> to complete the previous line -- which it doesn't. > > Actually, I think it does. But it doesn't strip the newline signs from > input, so just incidentally the resulting code is still valid Ruby, > with multiple lines. > > For example try this: > > irb(main):001:0> :- > irb(main):002:0* .object_id > => 548 Hmm, strange. Here's more irb interaction: irb(main):001:0> :- irb(main):002:0* .object_id => 548 irb(main):003:0> :- irb(main):004:0* 1 => 1 irb(main):005:0> :- 1 SyntaxError: (irb):5: syntax error, unexpected tINTEGER, expecting $end from X:/Ruby/bin/irb:12:in `
' irb(main):006:0> Notice how when I typed "1", it just discarded the :- on the previous line. > I agree it seems like a bug. Anybody cares enough to report it? ;) If I get around to it. Adam Prescott wrote: > Maybe I'm missing something, but: > > > $ ruby -ve 'puts :- > .class' > ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux] > Symbol So Ruby and IRB are consistent in this respect. But I would still expect Ruby *not* to wait for the next line when it encounters a symbol like :- at the end of a line.