At 5:05 PM +0100 4/26/02, Tim Bunce wrote:
>On Fri, Apr 26, 2002 at 11:33:06AM -0400, Dan Sugalski wrote:
>>  At 2:26 PM +0100 4/26/02, Nicholas Clark wrote:
>>  >On Tue, Apr 23, 2002 at 01:25:15PM -0400, Dan Sugalski wrote:
>>  >>  At 12:36 PM -0400 4/23/02, Buddha Buck wrote:
>>  >>  >OK, but that limits you to the, um, 24 standard levels of
>>  >>  >precedence.  What do you do if you don't think that that's enough
>>  >>
>>  >>  Internally precedence is going to be stored as a floating-point
>>  >>  number. Dunno how it'll be exposed at the language level, but at
>>  >>  least there'll be more than just 20 or so levels.
>>  >
>>  >Why store precedence as floating point rather than integer?
>>  >[Or did I miss a design document}
>>
>>  Because, while you may run into problems fitting something in between
>>  1.0000001 and 1.0000002, it's not a problem to fit something between
>>  3 and 4. Floating point precedence is a problem at the edge, but
>>  integer precedence makes things potentially difficult for user-added
>>  operators if you want to fit things between the standard operators.
>
>Is it worth it?

I think so, yes.

>For perl at least I thought Larry has said that you'll be able to
>create new ops but only give them the same precedence as any one
>of the existing ops.

Don't recall that, though all decisions are subject to later 
revision. Still, it doesn't have to be exposed either. :)

>Why not use a 16 bit int and specify that languages should use
>default precedence levels spread through the range but keeping the
>bottom 8 bits all zero. That gives 255 levels between '3' and '4'.
>Seems like enough to me!

If we're going that route, we've essentially edged over into reals of 
some sort, at which point we might as well just make it a float.

>p.s. I missed the start of this thread so I'm not sure why this is
>a parrot issue rather than a language one.

It's a parrot issue in that it'll be welded into the parser part when 
the parser builds up its operator precedence table.

>I also probably don't know what I'm talking about :)

I'll believe that the first time I see it actually happen... ;-P
-- 
                                         Dan

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

Reply via email to