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? 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. 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! Floating point seems like over-egging the omelette. Tim. 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. I also probably don't know what I'm talking about :)