[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Can not puts '\c' in irb

Ronald Fischer

8/6/2007 1:26:00 PM

irb 0.9.5 for Windows:

irb(main):016:0> puts '\c'
irb(main):017:0'

i.e. irb expects a continuation line. Guess this is a bug?

In case someone has a more recent release of irb, does this still
occur in the newer one?

Ronald Fischer

--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162

5 Answers

Lloyd Linklater

8/6/2007 1:53:00 PM

0

Ronald Fischer wrote:
> irb 0.9.5 for Windows:
>
> irb(main):016:0> puts '\c'
> irb(main):017:0'
>
> i.e. irb expects a continuation line. Guess this is a bug?
>
> Ronald Fischer

What about

puts "\\c"
--
Posted via http://www.ruby-....

Ari Brown

8/6/2007 2:33:00 PM

0

You need to use double quotes " " instead of single quotes ' '
because you're dealing with an escape sequence (I assume).

But this is just my random guess at the solution to your problem...
so..... keep it ruby :-)


On Aug 6, 2007, at 9:26 AM, Ronald Fischer wrote:

> irb 0.9.5 for Windows:
>
> irb(main):016:0> puts '\c'
> irb(main):017:0'
>
> i.e. irb expects a continuation line. Guess this is a bug?
>
> In case someone has a more recent release of irb, does this still
> occur in the newer one?
>
> Ronald Fischer
>
> --
> Ronald Fischer <ronald.fischer@venyon.com>
> Phone: +49-89-452133-162
>
>

---------------------------------------------------------------|
~Ari
"I don't suffer from insanity. I enjoy every minute of it" --1337est
man alive




Ronald Fischer

8/6/2007 2:51:00 PM

0

> Ronald Fischer wrote:
> > irb 0.9.5 for Windows:
> >
> > irb(main):016:0> puts '\c'
> > irb(main):017:0'
> >
> > i.e. irb expects a continuation line. Guess this is a bug?
> >
> > Ronald Fischer
>
> What about
>
> puts "\\c"

This works, but that's not the point. The fact is that
puts '\c' works inside a Ruby program, but does not work
within irb.

Does anyone know whether this this a known limiation of irb, or a bug?

Ronald
--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162

keiju

8/6/2007 3:50:00 PM

0


>This works, but that's not the point. The fact is that
>puts '\c' works inside a Ruby program, but does not work
>within irb.
>
>Does anyone know whether this this a known limiation of irb, or a
>bug?

This is a bug of irb. I fix this bug in ruby-trunk(Ruby-1.9).


-- keiju

Ronald Fischer

8/8/2007 2:57:00 PM

0

> >This works, but that's not the point. The fact is that
> >puts '\c' works inside a Ruby program, but does not work
> >within irb.
> >
> >Does anyone know whether this this a known limiation of irb, or a
> >bug?
>
> This is a bug of irb. I fix this bug in ruby-trunk(Ruby-1.9).

Thank you! I had overlooked your reply and have in the meantime
already opened a bug report on the Ruby bug tracker (id 12868) :-(

Ronald
--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162