Over-eager optimization in Pike 8.1

2016-01-12 Thread Chris Angelico
int main() { array(int) positions=({4,3}); int pos=1; array unrolled=({}); foreach (positions, int nextpos) { write("Extending to %d\n",nextpos); for (;pos<=nextpos;++pos) unrolled+=({"Spam"}); } } The basic concept is that it should unroll an array of

Over-eager optimization in Pike 8.1

2016-01-12 Thread Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
With inlined byte code disassembly (and some braces and newlines): >int main() >{ === 3 1c entry === 3 30 function start === 3 30 mark_at(0) === 3 54 pop to mark === 3 90 fill_stack(4,0) === 3 b6 init_frame(0,4) >array(int) positions=({4,3}); === 4 be constant(0)

Over-eager optimization in Pike 8.1

2016-01-12 Thread Per Hedbor () @ Pike (-) developers forum
F_LOOP is rather simple. is type int? yes: is it 0? yes: end loop no: decrement call body no: call f_loop Note the absence of "or less than" in the check for 0. I guess there should be such a check. It's there in the interret_functions.h version. I will

lookup of named inherits with modules

2016-01-12 Thread Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum
Just " A::f(); ".

lookup of named inherits with modules

2016-01-12 Thread Arne Goedeke
The following artificial example generates a syntax error. What is the correct syntax? main.pike: class B { inherit FOO.A; void f() { FOO.A::f(); } } FOO.pmod: class A { void f() {} } Arne