Bret Pettichord wrote: >I am in the process of adding a new feature to Watir and have a question. > > Consider this code: > > headline = $ie.div(:text, 'Pragmatic Version Control') > link = $ie.link(:class => 'addtocart', :after? => headline) > > Would you assume that link was after headline, or headline after link? > I can make it work either way. Which is more intuitive? Or is it > confusing no matter what?
'after' is reflexive when used as a question. Is link after headline? It reflects its target to before its subject. 'after' is transitive when used imperatively. "Link! After link, headline!" So Ruby's silly ? and ! markers make more sense than we thought. "Whaddaya mean you can write anything and it doesn't check if you are really doing a query without side-effects inside a ? function?? I'm going back to a paranoid language with static typing and everything!" Now I just have to figure out how to stop adding get_ and I'm there. Who wants to write a tiny book /Elements of Ruby Style/ ? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general