From: John Joyce Date: 2007-05-11T11:53:52+09:00 Subject: Re: Defending Ruby's OOP On May 11, 2007, at 11:34 AM, Pe�a, Botp wrote: > From: Jason Roelofs [mailto:jameskilton@gmail.com] : > # Or better yet, tell him to design a language that has "if" > # "unless" etc as objects and see where that goes. What does having > # if/unless as objects even mean? > > Maybe they mean a boolean class. I myself would like a boolean > class in ruby. Sometimes, i feel if-else constructs too > restrictive,.. maybe i hate grammar rules.. (maybe because i find > english weird language??) > > anyway, can we chain booleans like this? > > (x<2).iftrue{"got it!"}.capitalize.each{|c| puts c} > =>G > o > t > > i > t > ! > > > Indeed, it is a pointless argument. Even smalltalk is not 100 percent OOP because the characters you use to type code are not objects. [ is not an object and neither is ] Big deal. 'if' could be made an object that responds to a message by returning the equivalent of 'jump' or 'goto' in ASM or not. (which is basically all if does in any language.) You could very well make if an object if you wanted to, but there would be little benefit, and only extra overhead for nearly pointless abstraction. The whole thing is just debasing an argument to win a debate.