Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> It's been a while since I wrote much Ruby, but I can vividly recall wanting to find the definition of a method and being frustrated at how difficult it often was.

Given Ruby's open classes and per-object metaclasses (which are still open), I'm pretty sure a general solution to "find the definition of the method being called at this point in the code" is impossible (and not just, "there is a single correct answer, no general solution is available" impossible, but "there is no guarantee that there is a single correct answer, and even for the subset of cases where there is, no general solution is available" possible.)



Ever used Smalltalk, Dylan or Common Lisp commercial tools?


No, nor have I missed the particular function described working with Ruby.

But, OTOH, I am aware that its possible to do good-enough-for-many-uses implementations of things for which a complete, general solution is impossible, including the function described.


Personally, I haven't -- is there a way that the benefits of these tools could be translated into a ruby-based environment? Are such solutions already available? Would be interested to know more.



Ahead of time, it can be impossible, but usually is quite trivial.

But finding the set of likely candidates is not that hard.

There are some pathological code-bases that dynamically defines lots of methods, but they are not that common.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: