RE: if statement not working
- Posted by Rod Jackson <rodjackson_x at hotmail.com> Mar 23, 2002
- 411 views
David Cuny wrote: > rforno wrote: > > > if s[1..2] = "/*" then ... > > could never work fine. It gives an error message telling conditions must > > be > > atoms. > > Yes, and that's perhaps the most suprising bit of all. You'd sort of > expect > that with an emphasis on being orthagonal, the 'if' would accept {0, 0} > as > false, and { 0, 1 } as true. Well, I'm kinda late into this thread, but I have to ask: Why would {0,1} be logically assumed to be true? I can't think of any reason for it to be seen as such that's obviously superior to all the reasons why it should be seen as false, or as invalid. (Serious question there. If there's some reason I'm missing, I'd be interested in hearing it, as the concept might have value in several places.) As of right now, I think having a sequence not be accepted as a statement of truth or falsehood makes sense; that being the case, a function like 'equal' becomes required to compare slices/strings. With THAT being the case, a large portion of this thread becomes moot, yes? Rod Jackson