ruby-debug: 1) @-sign, 2) v i <object>

A

Axel

Hello,

when using ruby-debug ( _not_ the standard debugger coming with Ruby),
I cannot get the @-sign typed. Is there a way to get it typed?

I'm using:
- a German keyboard
- Windows XP pro
- ruby-debug 0.9.3 (running it from cmd)
- ruby 1.8.4 (2005-12-24) [i386-mswin32]

When switching Windows to US-keyboard, @-sign works, but I have big
difficulties getting for exampel those brackets [ ] . (Additionaly, I
would be very slow in typing on it...)


Another thing, how does:

v[ar] i[nstance] <object>

work? - When using the exampel of Brian Donovan, slightly modified:

class My
def fib(n)
@fib_cache ||= [1, 1]
@fib_cache[n] ||= fib(n-1) + fib(n-2)
end
end

my = My.new
puts my.fib(20)

and set a breakpoint, continue and enter "v i My", I do not get
anything. .

Thank you!

Axel
 
M

Martin Krauskopf

Axel said:
Another thing, how does:

v[ar] i[nstance] <object>

work? - When using the exampel of Brian Donovan, slightly modified:

class My
def fib(n)
@fib_cache ||= [1, 1]
@fib_cache[n] ||= fib(n-1) + fib(n-2)
end
end

my = My.new
puts my.fib(20)

and set a breakpoint, continue and enter "v i My", I do not get
anything.

"v i <object>" list instance variables of the <object>

E.g. try to add one line at the end of you program, e.g. sleep 0.1, and
put breakpoint on it. Then you get the array of fibonacci numbers
@fib_cache listed after "v i my".

"v i <object>" uses object.instance_variables and there are not any on
My class, so you got nothing after "v i My"

m.
 
J

Jano Svitok

Hello,

when using ruby-debug ( _not_ the standard debugger coming with Ruby),
I cannot get the @-sign typed. Is there a way to get it typed?

I'm using:
- a German keyboard
- Windows XP pro
- ruby-debug 0.9.3 (running it from cmd)
- ruby 1.8.4 (2005-12-24) [i386-mswin32]

When switching Windows to US-keyboard, @-sign works, but I have big
difficulties getting for exampel those brackets [ ] . (Additionaly, I
would be very slow in typing on it...)

On Slovak keyboard, @ is typed by AltGr (the right Alt) with V. Try
pressing the keys with AltGr to find it.
 
A

Axel

Hello Martin,
E.g. try to add one line at the end of you program, e.g. sleep 0.1, and
put breakpoint on it. Then you get the array of fibonacci numbers
@fib_cache listed after "v i my".

Ahh, nice, this works! Thank you!

- Axel
 
A

Axel

Hello Jano,
On Slovak keyboard, @ is typed by AltGr (the right Alt) with V. Try
pressing the keys with AltGr to find it.

unfortunately, this doesn't work with ruby-debug, at least on my side.

With all other programs, for example notepad and cmd-shell, I get @
by AltGr + Q on my German keyboard; but not with ruby-debug. :(

Thank you,

Axel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top