Please Forward: Ruby Quiz Submission

From: Phil Darnowsky <pdarnows@yahoo.com>
Date: January 20, 2007 3:03:27 AM CST
To: submission@rubyquiz.com
Subject: Please Forward: Ruby Quiz Submission

Attached please find my modest solution to #110, which is the first
Rubyquiz I've bothered to submit, though I've been following the site
for about two months now--thanks for the fun challenges!

This solution doesn't pass the test suite for two reasons:

(1) I think, instead of just returning an array of possible expansions
in response to an ambiguous abbreviation, the Right Thing is to raise
an exception that carries that array around inside it. This is not
what the test suite is expecting, but of course it's trivial to modify
my solution to do that instead.

(2) This fails the assertions in line 118 & 131. I think that, even
though @class#aa is not defined at the moment that it's passed to
abbrev, it's valid to allow it to be called through an abbreviation at
any time after it's defined. You could also make the case, I suppose,
that the abbreviation :a should preclude @class#aa from being invoked
when a.a is called, but I'd consider this a pathological case to start
with. If this is the kinda thing you're going to go around doing, you
shouldn't act surprised when you get weird results.

Anyhow, I am going to bed--my girlfriend called in the middle of this
e-mail and the first words out of her mouth were "Why aren't you
asleep?" So I think I will.

Thanks again,

Phil Darnowsky

____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com

method_abbreviate.rb (1.14 KB)

ยทยทยท

Begin forwarded message: