On 10/15/07, Doug McNutt <[EMAIL PROTECTED]> wrote:
> At 18:20 -0700 10/15/07, Michael Barto wrote:
> >I think in the more newer languages, they have implemented true booleans. 
> >Perl
> >is kind of old school.
>
> use constant TRUE => 1;
> use constant FALSE => 0;
>
> Is a complete solution in perl 5.  There was once a reason back in the time of
> grandfathered languages for booleans which actually used only one bit of a
> precious word of memory. That would be a "true" boolean. I'll bet those "new 
> school"
> languages use a native word, 16 , 32, or perhaps 64 bits while arguing that 
> it's faster
> and better that way.

It is actually worse than you suspect.  Most of them implement boolean
types as objects (which take up more than one word).  On the plus side
they tend to be singleton objects, but the reference still takes up
(at least) a word.

Reply via email to