News for hackers. Stuff that matters.
Re:Strangest Language Features by cobrausn on Thursday December 15, 2011 @11:59AM (#3356884)
Actually, there is, just not as many upvotes as the others.

http://stackoverflow.com/a/2026849

Basically, it is possible to inherit a random class in ruby.

    class RandomSubclass < [Array, Hash, String, Fixnum, Float, TrueClass].sample
       ...
    end
Re:Strangest Language Features by raganwald on Thursday December 15, 2011 @12:07PM (#3356916)
I wouldn’t call that a strange feature, just a surprising consequence of an un-strange feature, namely that inheritance involves expressions and that classes are first-class entities.

Folks from certain other languages would be just as surprised to find out that you can alias classes by assigning them, return them from functions, and so on.