On Feb 9, 2007, at 6:00 PM, Phrogz wrote:

> On Feb 9, 4:46 pm, James Edward Gray II <j... / grayproductions.net>
> wrote:
>> On Feb 9, 2007, at 5:35 PM, Phrogz wrote:
>>
>>>   # Built-in classes for testing #4
>>>   :class_from_string => [
>>>     ["OpenSSL", OpenSSL ],
>>>     ["OpenSSL::Digest", OpenSSL::Digest ],
>>>     ["OpenSSL::Digest::DigestError", OpenSSL::Digest::DigestError ],
>>>   ],
>>
>> Technically those are constants, not classes.  For example, OpenSSL
>> is a module.  That neatly foils a solution someone sent me off list
>> today.  ;)
>
> I had wondered about that. The wording of the quiz says "class", but I
> figure that:
> a) Given the number of modules-as-namespaces over classes-as-
> namespaces, a good solution to the problem allows module stops along
> the way, and thus
> b) If you're going to allow non-classes along the way, you generally
> want the "resolve this as though I typed it" functionality, which may
> end in constants.
>
> BUT...if the quiz has the wrinkle that only Classes should be returned
> (and thus you should get  nil for the cases above), that would be
> interesting to program, too.

My solution handles either.

James Edward Gray II