From: Morton Goldberg Date: 2007-10-23T02:35:16+09:00 Subject: Re: Self-replicating Ruby On Oct 21, 2007, at 10:25 PM, Frank J. Lhota wrote: > Dear Ruby fans, > > A common Lisp exercise is to write a Lisp program that writes its own > source code to standard output. Reading from a source file is not > permitted. > > This leads one to wonder: what is the smallest and / or most elegant > Ruby program that writes its own source code to standard output? As > with Lisp, reading from a file is not permitted. Given the nature of > the language, this problem should should have a lot of interesting > solutions. My favorite Ruby quine is DATA.rewind STDOUT.write(DATA.read) __END__ Regards, Morton