develooper Front page | perl.perl6.language | Postings from July 2010

Re: Smart match isn't on Bool

Thread Previous | Thread Next
From:
Carl Mäsak
Date:
July 31, 2010 17:02
Subject:
Re: Smart match isn't on Bool
Message ID:
AANLkTi=dQU8uM2EVUKVVMuV8eeZMzhV7MeA11xYV_vYt@mail.gmail.com
Darren (>):
> All this being said, I really do *not* like the idea of saying Bool is just
> a subset of Int as it seems to be.  Bool should be disjoint from every other
> common type like Int/Str/etc instead.

I don't know whence you got the impression that Bool is a subtype.
Bool is an enumeration type, which makes True and False distinct
objects both of which aren't (but instead wrap) their corresponding
Int values.

> Asking "False eqv 0" should be false, though either "False eqv ?0" or
> "+False eqv 0" being true is okay.

All those are as you want them.

// Carl

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About