Michael Neumann wrote: > Brian Mitchell wrote: > >> On Wed, 23 Feb 2005 03:00:03 +0900, Michael Neumann >> <mneumann / ntecs.de> wrote: >> >>> Caio Tiago Oliveira wrote: >>> >>>> Michael Neumann, 22/2/2005 11:25: >>>> >>>>> 100% agree. I especially cannot understand (at least mathematically) >>>>> why 0 would be empty and 1 not. >>>>> (...) >>>> >>>> >>>> >>>> Binary logic, 0 is false, 1 is true. >>> >>> >>> In fact, those are actual symbols and not numbers! >> >> >> >> exactly! This issue seems to come up on the ML from time to time. I >> voiced my opinion that Smalltalk conditionals (depending on behavior) >> are much better than depending on value (check for nil or false). It >> can be tailored to fit any object easily... but I think the idea lost >> out to people who would rather keep ruby more of that same and >> probably a little faster (though there are some things ruby can't do >> because of this). My vote is still up for .true? {} and .false? {} >> >> ;-) >> >> I really don't care if you guys agree or not but it sure is elegant. >> Ruby is already a very good language so I am happy anyhow. > > > At least for .nil? I agree. I am not sure whether I'd like to write > "if a.true?" all the time. Nevertheless I believe that > I don't think the proposal was to replace if a with if a.true? but rather to replace if a code end with a.true? { code } > if a.false? > > is clearer to read and understand than: > > if not a > likewise this would be a.false? { code } which is the way that Smalltalk works > Just because human mind if very bad at negating conditions (proven by > studies of some psychologists). -- Mark Sparshatt