Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Perl on OSX > Re: Is there a ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 11 Topic 1001 of 1076
Post > Topic >>

Re: Is there a True Boolean type in Perl?

by chas.owens@[EMAIL PROTECTED] (Chas. Owens) Oct 16, 2007 at 06:01 AM

On 10/15/07, Doug McNutt <douglist@[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.
 




 11 Posts in Topic:
Is there a True Boolean type in Perl?
mbarto@[EMAIL PROTECTED]   2007-10-15 13:27:26 
Re: Is there a True Boolean type in Perl?
chas.owens@[EMAIL PROTECT  2007-10-15 16:54:08 
Re: Is there a True Boolean type in Perl?
merlyn@[EMAIL PROTECTED]   2007-10-16 12:25:29 
Re: Is there a True Boolean type in Perl?
gblackburn@[EMAIL PROTECT  2007-10-15 17:25:23 
Re: Is there a True Boolean type in Perl?
jeremiah@[EMAIL PROTECTED  2007-10-15 23:59:55 
Re: Is there a True Boolean type in Perl?
mbarto@[EMAIL PROTECTED]   2007-10-15 18:20:22 
Re: Is there a True Boolean type in Perl?
douglist@[EMAIL PROTECTED  2007-10-15 19:40:19 
Re: Is there a True Boolean type in Perl?
trey@[EMAIL PROTECTED] (  2007-10-17 12:40:08 
Re: Is there a True Boolean type in Perl?
chas.owens@[EMAIL PROTECT  2007-10-16 05:55:15 
Re: Is there a True Boolean type in Perl?
chas.owens@[EMAIL PROTECT  2007-10-16 06:01:02 
Re: Is there a True Boolean type in Perl?
david@[EMAIL PROTECTED]   2007-10-16 16:19:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 0:17:02 CST 2008.