Re: request for change of boolean
- Posted by Matt Lewis <matthewwalkerlewis at gm?il.c?m> Dec 06, 2007
- 836 views
Kat wrote: > > I liked the way bool and bytebool worked and evaluated in Pascal. Rather > like common sense, or a checkbook. If the value was positive, any value, > then it was there, money was in the checkbook, it was TRUE. If it was > negative or zero, it was not there, there was no money, and it evaluated > to FALSE. Somehow, it makes sense to me that Eu would have extended that > to sequences (so {0,0,0,-300} = false, while {0,0,5000,0} is true). In > reality, it seems to be not only flamebait on my butt, but a great example > of why it's a good idea to NOT provide specific code to illustrate a point. First, I didn't think that your post was flamebait, nor do I think that Derek did, based on his response. My impression was that he * considered your proposal * asked for some more background to understand the motivation behind your request * offered a work around for the specific case you mentioned * discussed the reasoning behind the functioning of open() * offered another work around Then Juergen commented on Derek's post (that one doesn't strike me as a flame, either). CChris kinda agreed with you, and showed you how he works around it, then offered another work around. As I can rarely resist, I'll offer my own 2 cents on the topic. There are languages that treat -1 as TRUE and 0 as false. This makes more sense when you look at them bitwise--all bits either on or all bits off. Whatever the merits may be for changing the truth evaluation in euphoria, it would likely break a lot of code, so there'd better be a real good reason behind it. And I doubt that "not having to type 'var >= 0'" would make the cut. Obviously, you could write a function that would return 1 or 0 based on your description of PASCAL. Matt