At 5:28 PM -0700 5/16/02, Brent Dax wrote:
>Dan Sugalski:
># Okay, I've checked in the final changes to this edit of PDD 2, the
># vtable pdd. Tine to rip into it^W^W^Wexamine it closely. :)
>
>I guess I'm first.
>
>I think the PARROT_TRUE/PARROT_FALSE thing is a Really Bad Idea.

I'm not thrilled with it either, but I don't want to be checking the 
exception flag in the interpreter when we don't have to. I'm not at 
all happy about the calls that do have to check. I currently consider 
that the lesser of two evils. Evil, yes, just less evil

>I understand that we need a way to indicate exceptions.  However, I
>think that it either must be out-of-band or it needs to have a much
>rarer value.  I would much prefer if it was completely out-of-band, but
>if that's not possible at least choose a different value; ~0 jumps out
>at me as a possibility.

Pssst. Brent. Don't tell anyone, but ~0 *is* -1... :)

>C people are used to being able to say
>
>       if(foo()) {
>               true
>       }
>       else {
>               false
>       }

Right, instead it's

      if (!status = foo()) {
         throw_exception();
      else {
         if (status > 0) {
           true
        } else {
           false
        }
      }

Great? No. Better performance, though, than explicitly going out and 
checking the interpreter structure for an outstanding exception. Not 
only does that mean we're accessing more memory so there's less cache 
coherency, but it also means that more routines will have to 
explicitly clear the exception status.

>and I believe it would be incredibly counterintuitive to make them use
>explicit comparisons.  Also, it more correctly maps onto various
>languages--last I checked, -1 is true in Perl and other languages that
>ascribe boolean values to integers.

People can cope. I'm not worried about that.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to