One of the things that I really like about Ruby is that it doesn't
require something (e.g., a variable, a method, an object) to be there
until you actually execute the code that references that entity.
It makes rapid prototyping, piece-wise testing, and piece-wise refinement
really nice.  However, its a two edged sword in that errors in little
executed pieces of code (e.g., the "else" clause of a case statement,
rescue clauses may contain bugs that may not show up until much later
in the development phase, and which may have been easier to fix if
found earlier.  One possible way around this (there may be others that
I haven't thought of, suggestions are welcome) would be a program
similar to the "lint" program sometimes used against C source programs.
It would do static analysis against a Ruby program and provide a list
of warnings for such things as:

    variables, constants, methods, objects, used before they are
    created.

    unbalanced if --- end, unless -- end, while --- end constructs

    nested def's

    ?? suggestions

With Ruby being as dynamic as it is, it would probably not catch
everything, and might issue warnings against code which is actually
correct.  And, since its use is optional, it would slow down those
who choose not to use it.

Is / has anybody done any work on this type of an analysis tool?

Thanks.

Dennis

---------------------------------------------
|                                           |
|     The way to be happy is to be good     |
|                                           |
---------------------------------------------