#!/usr/local/bin/rune -x # # Demonstrate a loop. library limport "sys"; # The interpreter should be able to optimize out the call to fubar(). # # Test it by replacing fubar(loops) with 100000000 and seeing if # it takes the same amount of time. # pure long fubar(long value) { return (value); } # The interpreter should be able to optimize out constant values from # variables. # # Test it by replacing fubar(loops) with loops or (loops) and seeing # if it takes the same amount of time. # const long loops = 100000000; int main(int ac, char **av) { long i; for (i = 0; i < fubar(loops); ++i) ; # for (i = 0; i < 100000000L; ++i) # ; }