Skip to content

Comment on Ruby-jokes/job_interviewparent

Comments

I don't know Ruby, so this is probably obvious, but: Why does quine() need an argument? What good is __FILE__ there?

Even though you don't know ruby, you should really check out the source code. It's very simple. __FILE__ is a reference to the current file name.

If you'd looked at the source code, you'd see that it's actually a pretty cheap quine, since it has access to that magic variable. You could do the same thing with just:

puts File.read(__FILE__)

Oh man, i was just thinking of this in terms of a REPL and didn't think of incorporating it into a file. duh :) thanks

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.