From: Robert Klemme Date: 2007-08-19T20:19:58+09:00 Subject: Re: 8086 simulator in ruby On 18.08.2007 17:04, John Joyce wrote: > > On Aug 18, 2007, at 9:24 AM, Chris Carter wrote: > >> On 8/18/07, Phlip wrote: >>>>> Think of do-end as a block that iterates 1 time. That's what it is! >>> >>> Please read my posting history, blogs, Ruby open source, etc. (-; >>> >>> Robert Klemme wrote: >>> >>>> Actually it's not the "10" but the "times" because "CPU8086" would be a >>>> method. >>>> >>>> def CPU8086(&b) >>> >>> The point: I thought a method was forbidden as a constant. Easy to >>> write but >>> hard to call. Phlip, not sure what you meant by this. It's not different from any other method. >>> By contrast... >>> >>> doc = Hpricot(my_html_string) >>> >>> His Whyness did something to the module to make it take a method call >>> directly... >>> >> >> No modules were hacked or harmed. He just defined a method: >> >> 3 def Hpricot(input = nil, opts = {}, &blk) >> 4 Hpricot.parse(input, opts, &blk) >> 5 end >> >> http://code.whytheluckystiff.net/hpricot/browser/trunk/lib/hpricot/parse.rb > > Yep, normal stuff. EXCEPT for the capitalization. You can do it, but it > goes against usual style. Even the std lib does it: irb(main):019:0> Kernel.methods.grep /^[A-Z]/ => ["Integer", "Float", "String", "Array"] I don't see a big issue here. Kind regards robert