As a rubinius newbie, sorry for the barrage of questions.

I've just started rubinius and attempting to port the experimental
Ruby 1.9.2 debugger (http://github.com/rocky/rbdbgr) to rubinius.

1. require_relative

The first thing I really miss is Ruby 1.9.2's require_relative. Is the
omission intentional or its just something not got around to yet?

I find require_relative very helpful in internal linking of submodules
of a large program. Although one can replace "require_relative" with
File.expand_path(File.dirname(__FILE__)) + ..., it also seems
straightforward code. Would folks be interested if I worked up a patch
for this?

2. Rubinius::Location object

In implementing require_relative, this leads me to the next thing. Is
there a way to get a Rubinius::Location object from Ruby? Recall that
caller returns an Array of String. The implementaion of that is using
Rubinius::Location, but it would be simpler and more reliable for
something like require_relative to not have to unparse the string in
the Array element. It's also useful in other context as well and I
suspect some of the existing Rubinius code could be cleaned up a
little by not having to unparse the caller string.

So is there a way to get at this? Any objection to adding it, say if I
were to do so?

3. SCRIPT_LINES__

In MRI/YARV Ruby, when SCRIPT_LINES__ is set to a hash, every time
Ruby source is loaded SCRIPT_LINES__ contains the source text. I
realize that Rubinius can probably read the "compiled" version (.rbc)
and so the source might not be around, however when the source is
around, it could be loaded into SCRIPT_LINES__. You may say, yes, but
if we read in a rbc, how do I know that the source matches the
compiled version, and I have an answer for that too, but this is
already too long, so let me defer that until getting what the reaction
to adding SCRIPT_LINES is.

- - -

Lastly, let me say something about my modifications to the reference
debugger which I've started yesteray. There are some things in there
that look cool, and I'll probably retrofit some of the other debuggers
to match this.

In terms of debugger file names and method names, in some cases even
though the rubinius names are probably better, since it would be more
work for me to retrofit possibly 6 or 7 other debuggers to match, I'll
probably live with my, possibly more clunky, names. For example in the
reference debugger there is a file called "display.rb" which I call
"msg.rb". In that, there are methods "info", and "error" which I call
"msg" and "errmsg". The error message prefix in the reference debugger
is "* ", but here I've compromised a little and made that "** ". (3
debuggers previously used "** " and the while the ruby debuggers use
"*** ". I've changed rbdbgr already, but will keep ruby-debug the
same, lest I break things. I know this is all little piddle-shit
stuff, but alas such things in the long run do make it easier when
things are the same across the board.

-- 
--- !ruby/object:MailingList
name: rubinius-dev
view: http://groups.google.com/group/rubinius-dev?hl=en
post: [email protected]
unsubscribe: [email protected]

Reply via email to