Dan Sugalski <[EMAIL PROTECTED]> wrote: > This becomes a bit less efficient when we're looking at intermediate > values of expressions. Something like:
> a = b + c + d > turns to > new $P0, SomeIntermediateType > add $P0, b, c > add a, $P0, d > and we need to create that $P0 temp beforehand. While that's fine, it > leave things to the compiler to figure out what the intermediate type > should be, and often ends up creating two temps instead of one. Well, yes. It's up to the compiler. Perl6 would insert $P1 = new PerlUndef and Pie-Thon would have a C<new PieScalar> or such. Why should it create two temps? > Moreover, it's distinctly possible that the temp that's created isn't > the right type, as the compiler may not know what the intermediate > expression will return. The C<new Undef> something has to morph itself into an appropriate type IMHO. > I see three options: I think its really up to the HLL compiler to generate a suitable LHS PMC that (accompanied by appropriate assign vtables) does the right thing. To you have examples, which indicate that this isn't possible? leo