On Monday 13 January 2003 11:33 pm, Gavin Sinclair wrote: | On Tuesday, January 14, 2003, 2:53:20 PM, Shashank wrote: | > Very nice ... | > | > One question: | > | > In the "Our First Test" section, you say: | > | > Ruby Comments: The require keyword in Ruby looks in the ruby | > libraries for a file named 'test/unit.rb' and will load it in to the | > running program. | > | > Is "require" a keyword (i.e. reserved) in Ruby ? I always understood | > it as a function which took filename as argument. | | It is a method, but calling it a keyword probably makes more sense to | the target audience, who are expected to be unfamiliar with Ruby. | | "require" occupies a space in programming languages usually known as | "keywords", or in this case, "directives". Implementation details | don't really change that. | | Gavin Gavin, Although I agree w/ the intent of your comment, the following has always annoyed me: "Ok class-- what I taught you over the past three weeks was actually WRONG. Now let's try to get rid of your bad habits by teaching you the RIGHT thing." If they know what a keyword is (or rather, it matters to them), they can probably grasp 'method' without too much of a stretch-- In the very least, I think it's a vital part of anyone's Ruby knowledge-- I've ran across too many people that don't know how Ruby is structured at the toplevel because they learned concepts similar [to the above] and never un-learned them, assuming the setup was similar to less-OO languages they had used before. Implementation details, of course, don't change the fact that people percieve it as a keyword. But let's not support it with technical writing as well... if you have to, don't label it at all: | > Ruby Comments: [Using] 'require' in Ruby looks in the ruby | > libraries for a file named 'test/unit.rb' and will load it in to the | > running program. Just my 2c. I know that doesn't buy much these days ;-). -- Bruce R. Williams :: [iusris/#ruby-lang] :: http://www.codedbliss.com 'It does not require a majority to prevail, but rather an irate, tireless minority keen to set brush fires in people's minds.' -- Samuel Adams