"Hal E. Fulton" <hfulton / austin.rr.com> writes: > That's fine, but it does bother me a little that typesetting > (traditionally the publisher's job) is being done by authors now > just because they have better tools than they used to. Well, one of the reasons for typesetting your own technical books is the accuracy of code samples. The Ruby book we're writing currently has over 1,200 code samples in the text. Traditionally, we'd have supplied the publisher with each on a separate sheet of paper, with a reference number tying it back to the place it belongs in the source. The code would then be manually entered, and we'd have to scan each, again manually, for any errors. However, typeset the book ourselves, and we have other options. In our case, the code sits inline in the source of the book. Every time we format the book, the code gets executed. In many cases, the output is then inserted back in to the book. During the production of the book, these code samples have found bugs in Ruby, and fixes to Ruby have found bugs in the code samples. The expected result for us is a more accurate book. > Now, to talk about something more on-topic... :) > > I have recently discovered that things that I thought were "reserved > words" can actually serve as method names and the like. > > This shocked me. It doesn't really bother me, but it surprised me. > > For example, I used a method named "class" and it worked fine. Ruby actually has a method 'class' in object: p 1.class # => Fixnum In terms of how it works: In this case, the use of 'class' as a method name is unambiguous, so it says "go for it". In fact, the parser actually makes a special case of just this, casting the reserved word into an ID for the occasion. Regards Dave