[plt-scheme] Re: boolean operators on integers

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Sat Jul 12 10:03:23 EDT 2008

Thanks for your honesty.  Please just type #f instead and all will be well
in your world.  Think of the extra typing as your punishment for trying to
abuse numbers.

On Sat, Jul 12, 2008 at 10:01 AM, wooks <wookiz at hotmail.com> wrote:
>
>
> On Jul 12, 8:53 am, "Shriram Krishnamurthi" <s... at cs.brown.edu> wrote:
>> 1. In Scheme, 0 and 1 are both true values.  Neither of them is false.
>> In Scheme, only one value is false: #f, or false.
>>
>> 2. In Scheme, AND returns the value of the last expression so long as
>> it isn't false.
>>
>> You're seeing the combination of these two behaviors.
>>
>> Why are you using 0 instead of #f/false to represent a false value?
>
> because
> a) my function has several of these boolean type arguments
> b) 0 has fewer characters than #f and false
> c) I thought it would work
>
> there - stupid but honest.
>
>> Or is it that 0 represents falsity in your domain, and you need to map
>> it to false?  If so, use the code Robby sent.
>>
>
> ok.... and I learnt interesting useful along the way.
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.